May 27, 2007 - Geeky General    Comments Off on Running scripts with a batch file using cscript.exe

Running scripts with a batch file using cscript.exe

There is a file in Windows called cscript.exe that can be used to run scripts.

To run a script as a batch file (.bat), with credentials, create a batch file use the following syntax.

To prompt you for the password:

runas /user:username "cscript.exe //D \\avnwdc13\renameprof\install_service.vbs"

To include the password:

runas /user: username /password:password "cscript.exe //D \\avnwdc13\renameprof\install_service.vbs"