Home > Commands A-M > Batch E

EXIT


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Quits the the operating system command interpreter (COMMAND.COM or CMD.EXE) and returns to the program that started the command interpreter, if one exists.


Syntax

EXIT /?

EXIT [/B] [exitcode]


Parameters
exitcode (NT2000)
Specifies a numeric number. If /B is specified, sets %ERRORLEVEL% to that number. If quitting CMD.EXE, sets the process exit code with that number.

Switches
/? (NTXP)
Display help.
/B (NT2000)
Specifies to exit the current batch script instead of CMD.EXE. If executed from outside a batch script, it will quit CMD.EXE.

Related

none.


Notes
Using exit with the command interpreter

When you use the the operating system COMMAND or CMD or command to start a new instance of the command interpreter, you can use the EXIT command to return to the old command interpreter. Also, while running some programs, you can run the the operating system command interpreter and then use the EXIT command to return to your program. For more information about command interpreters.

If you are not using the /P (permanent) switch with the initial copy of COMMAND.COM, the EXIT command quits the command interpreter. You must then specify at the command prompt the location of the COMMAND.COM file to start the command interpreter again.


Using exit when the command program is loaded as permanent

If you start the COMMAND.COM program with the /P (permanent) switch, the EXIT command has no effect.


Examples

none.


Errorlevels

none.


Availability
Internal
DOS
v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10 v8.00
Windows
Win95 Win98 WinME
Windows NT
NT3.5 NT4 NT2000 NTXP NT2003