I am trying to write a VBScript that will use local admin rights to run another script. However, for some reason I can't get the RUNAS command to take the password. I am including my script below:
set WshShell = CreateObject("WScript.Shell") WshShell.Run ("%comspec% /k RUNAS /user:/LocalACCOUNT/LOCALcomputerNAME C:proxyDISABLE.vbs") Wscript.Sleep 500 WshShell.Sendkeys "PASSWORD~"
The exact error is: RUNAS Error: Unable to acquire user password.
I have tried changing the Sleep time to several different values - no luck. Tried switching computer and user name locations - no luck.
However, I can use RUNAS when I shift click a program - so I know it works.
Any help or advice is greatly appreciated!
January 24, 2005 3:08 AM
August 20, 2013 6:56 PM