Scripting Home > > WScript Methods

Quit Method


The Quit method is used to terminate the execution of the current script with a specified error code.

object.Quit [ErrorCode]

The optional ErrorCode parameter is used to specify a process exit code. If omitted, 0 (zero) is returned as the process exit code.


'terminate the current script

'terminate the current script with exit code 2
WScript.Quit 2