Scripting Home > > WScript Methods

Quit Method

Description

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.

Example

'terminate the current script
WScript.Quit

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