Home NT WSH
WshScript.Quit

Exit the WSH script.

Syntax 
      WScript.Quit intErrorCode

Arguments:
   intErrorCode : The exit or error code. 
                  (Int, Optional)
                  default is to return no value (0)
Example
WScript.Quit 1

In a batch file catch the Errorlevel with

cscript.exe MyScript.vbs
IF errorlevel 1 goto s_next

The use of exit codes with .wsf files is supported from WSH version 5.6

"You might as well aim high.
Why shoot yourself in the foot when you can shoot yourself in the head? - William Shatner


Related commands
:


Equivalent Windows NT command:

EXIT - Quit the CMD shell



Back to the Top

Simon Sheppard
SS64.com