"Run As," Adding Names to Drop-Down Box

  • Thread starter Thread starter M.H.
  • Start date Start date
M.H. said:
In Task Manager, it is running under the other, correct account. It is
closing properly as well, as the program is no longer listed in Task
Manager after quitting from it. Maybe you have to have the password
line in the script with the /savecred switch on one run? Although that
doesn't make sense, as it still prompted me for the password after
removing the password line, although only once.1


set WshShell = CreateObject("WScript.Shell")
WshShell.Run "runas /user:""M. xxxxx"" /savecred ""C:\Program Files\Liberty
BASIC v4.03\liberty.exe"""

Yes, I forgot about the /savecred switch, thanks for pointing this out. The
/savecred switch does not work for Windows XP Home according to "runas /?".
Now the runas command doesn't prompt me for the password after I enter the
password on the first run of the script. You can also remove the sleep.100
line if you would like. You could also use the following in a batch file:

runas /user:"M. xxxxx" /savecred "C:\Program Files\Liberty BASIC
v4.03\liberty.exe"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top