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
Equivalent Windows command:
EXIT - Quit the CMD shell