WScript.Quit

Exit the VBScript script.

Syntax 
      WScript.Quit [intErrorCode]

Arguments:
   intErrorCode  An exit (or error) code

The default is to return no value (0)
Quit is a wscript method.

Examples

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

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

Related

Exit - Exit a subroutine.
Equivalent Windows CMD command: EXIT - Quit the CMD shell
Equivalent PowerShell cmdlet: Exit


 
Copyright © 1999-2024 SS64.com
Some rights reserved