jcredle
asked on
wscript.sleep not working
Can someone tell me whats up with this code, please? Everytime I try to debug this it says that line 4 has a error and the error description is "Object required (WScript) - Sleep
Dim sh
Set sh = WScript.CreateObject("WScr ipt.shell" )
sh.Run "runas /user:local administrator ""manage1.msc"""
WScript.Sleep(5000)
sh.SendKeys "password~"
WScript.Quit
Dim sh
Set sh = WScript.CreateObject("WScr
sh.Run "runas /user:local administrator ""manage1.msc"""
WScript.Sleep(5000)
sh.SendKeys "password~"
WScript.Quit
This works for me, at least, without the third line, but the sleep call works on XP. I don't suppose it could be as simple as getting rid of the brackets? So, WScript.Sleep 5000. Also, I take it you are running this as a .vbs file?
ASKER
Yes, I am using this as a .vbs file. I tried to run the script without the brackets also.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.