WshScript.Quit
Exit the VBScript script.
Syntax
WScript.Quit [intErrorCode]
Arguments:
intErrorCode An exit (or error) code
The default is to return no value (0)
Example
WScript.Quit 1
If calling a VBScript from a batch file, catch the Errorlevel with an IF statement
cscript.exe MyScript.vbs
IF errorlevel 1 goto s_next