Running Scripts Using Cscript.exe

To use Cscript.exe, open a Command Prompt window and type a Cscript command line. CScript uses the following syntax:

cscript [host options...] [script name] [script options]
 

Each parameter is optional; however, you cannot specify script options without specifying a script name. If you do not specify parameters, Cscript displays the Cscript syntax and the valid host parameters.

Cscript.exe supports the host parameters shown in the following table.

Parameter Description
//T:nn Enables time-out: the maximum number of seconds the script can run. The default is no limit. (See the text following this table for more information on this parameter.)
//logo Displays a banner (default; opposite of //noLogo).
//nologo Prevents display of an execution banner at run time.
//S Saves the current command-line options for this user.
//? Shows command usage (same as with parameters).

The //T parameter prevents excessive execution of scripts; it does this by setting a timer. When execution time exceeds the specified value, Cscript interrupts the scripting engine using the IActiveScript::InterruptThread method and terminates the process.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.