Previous Topic: regSetVal--Set Registry Value (Function)Next Topic: shellType--Query AutoShell Type (Function)


setProcExitCode--Set AutoShell Exit Code (Function)

This function sets the AutoShell exit from a user script overriding a possible AutoShell defined exit code. On Windows systems, the exit code can be retrieved through the %errorlevel% variable after AutoShell terminates.

The function has the following syntax:

setProcExitCode(iExitCode)
iExitCode

Specifies the exit code.

Example

Set the AutoShell exit code to -42 and exit AutoShell:

setProcExitCode(-42);
quit

See also:

exit, quit Commands--Terminate an AutoShell Session (Cmdlets)