Exit command
Updated: 11/12/2023 by Computer Hope
The exit command is used to withdraw from the currently running application and the MS-DOS session.
Availability
Exit is an internal command and is available in the following Microsoft operating systems.
- All Versions of MS-DOS
- Windows 95
- Windows 98
- Windows Me
- Windows NT
- Windows 2000
- Windows XP
- Windows Vista
- Windows 7
- Windows 8
- Windows 10
- Windows 11
Exit syntax
Windows Vista and later syntax
Quits the CMD.EXE program (command interpreter) or the current batch script.
EXIT [/B] [exitCode]
/B | Specifies to exit the current batch script instead of CMD.EXE. If executed from outside a batch script, it quits CMD.EXE. |
exitCode | Specifies a numeric number. If /B is specified, sets ERRORLEVEL that number. If quitting CMD.EXE, sets the process exit code with that number. |
Windows XP and earlier syntax
Quits the COMMAND.COM program (command interpreter).
EXIT
Exit examples
exit
- When in another command interpreter, exit takes you out of the new command interpreter and back into the original.
- When entering DOS from Windows, exit would return you to Windows.
- If you're in the Recovery Console, exit would close the Recovery Console and reboot the computer.