I have a vbscript file that has a username and password input box in it's own window with an OK and Cancel button stacked upon each other. When the user clicks OK to submit the password, I want a new file to open. Here's my code:
set objShell = WScript.CreateObject("WScript.Shell")
strUserName = inputBox("Username")
strPassword = inputBox("Password")
objShell.Run "runas /user:" & strUserName & " ""wscript.exe c:\path\myscript.vbs"" "
Can anybody help me?
If I replace the last line of code, when you click OK, the program closes and nothing happens. The current code opens a command prompt window with the title "C:\Windows\System32\runas.exe" and it just says enter the password for (username you typed) : ex Enter the password for dog :. Whenever you press enter, it closes.