Discussion Locked

Scripting Run as different user

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is it possible to script running a program as a different user. I have a program that needs admin privilages to run. Currently I have the program shortcut setup to use the run as different user. Then the Run as different user dialog box pops up and they enter the password for the admin privilages. Is there anyway that a username and password can be passed without the user ever having to do anything but click on the shortcut? Any help is greatly appreciated.

7 replies

by joncr

Try the runas command. The problem is that the password will have to be in plain text in a batch file so there are security implications. A better example would be to put this in an AutoIt exe file (AutoIt is a program similar to ScriptIt but you can turn your scripts into exe's). This would hide the password.

by shmaltz

This is usualy only possible using SMS. What answer one suggests converting your script to exe will not help since if you open it in notepad you will still be able to see the password.

by steve.timmons

I have done what the first guy suggested with AutoIT and it works.

In SMS you can run jobs as an administrator because SMS has a facility to do just that.

This discussion is closed to new replies.