any ideas?system('runas /user:administrator cmd'); sleep2; system('thepassword'); sleep2; system('echo did it work?'); but naturally the system waits until runas has finished before going o +n. VBS handles it like this set WshShell = CreateObject("WScript.Shell") WshShell.Run "C:\Winnt\System32\Runas.exe /USER:administrator cmd" WScript.Sleep 2000 '1 Send keys to enter password. WshShell.SendKeys "thepassword" WScript.Sleep 580 '1 Send Enter key. WshShell.SendKeys "{Enter}" WScript.Sleep 500 '1 Send other keys. WshShell.SendKeys "echo commands here run in admin mode" WScript.Sleep 500
Edit by tye to replace password
In reply to sending test to command prompt by ironpaw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |