CScript.exe / wscript.exe
Run a Windows Scripting Host (WSH) script.
'cscript' runs entirely in the command line and is ideal for non-interactive scripts.
'wscript' will popup Windows dialogue boxes for user interaction.
Syntax
cscript [ScriptName.vbs] [cscript_options...] [script_arguments]
wscript [ScriptName.vbs] [wscript_options...] [script_arguments]
Options:
ScriptName.vbs : Text file containing VBS commands to be execute.
You must include the extension (normally .vbs)
//T:nn Timeout script after nn seconds
//nologo hide startup logo
//Logo or Display logo (default)
//I Interactive mode
//B or Batch mode
//E:engine Use engine for executing script
//H:CScript Change the default to CScript.exe
//H:WScript Change the default to WScript.exe (default)
//Job:xxxx Execute a WSF job
//S Save current command line options for this user
//D Active Debugging
//X Execute script in debugger
//U Use Unicode for redirected I/O from the console
Examples
Run the VB script called myscript.vbs:
C:\> cscript myscript.vbs
If the line above is saved as a batch script, double clicking the batch file will run the VBScript file.
Call one VB script from another. This can be done as shown below, although it is usually better to put everything in a single script and use Functions to split up the blocks of code.
Set objShell = CreateObject("WScript.Shell")
objShell.run("cscript C:\scripts\demo.vbs")
The VB Script scripting environment is installed by default on Windows 98 and all later versions of Windows.