How do I run a windows script from the command line?


When you run a Windows Scripting Host file such as a Visual Basic or Java script, Explorer WSCRIPT.EXE is executed and runs the script using the necessary script plug-in.

To run from the command line, use CSCRIPT.EXE which has a number of optional parameters.




Suppose you had the following hello.vbs file:

Wscript.Echo "Hello" Wscript.Quit 0

You would run with command
C:\> cscript hello.vbs

which would print Hello to the command window. Typing
C:\> wscript hello.vbs

would bring up Hello in a window.

Maputo à Mesa: Um Roteiro Irresistível Pelos Sabores Mais Amados da Cidade!

Olá, amantes da boa comida e viajantes curiosos! Se há uma coisa que Maputo sabe fazer, é cativar pelo paladar. A capital moçambicana é um v...