Exit command in Windows
The exit command exits the Cmd.exe program (command interpreter) or the current batch script. To learn how to use this command, please see the example below.
Applies to : Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012.
The exit command exits the Cmd.exe program (command interpreter) or the current batch script. To learn how to use this command, please see the example below.
The exit command is an internal command and is available in all versions of MS-DOS below Microsoft:
- Windows 95
- Windows 98
- Windows ME
- Windows NT
- Windows 2000
- Windows XP
- Windows Vista
- Windows 7
- Windows 8
- Windows 10
Syntax of exit command
exit [/b] [] Parameters
The Description / b parameter exits the current batch script instead of exiting Cmd.exe. If done from outside a batch script, it will exit Cmd.exe. exitCode Specifies a number. If the / b parameter is specified, the environment variable ERRORLEVEL is set to that number. If you are exiting Cmd.exe, then the process exit code will be set to that number. /? Show help at the command prompt.For example
To close the Cmd.exe command interpreter, enter:
exit - When in another command interpreter, exit will exit the new command interpreter and return to the original command interpreter.
- When you import DOS from Windows, the exit command will return you to Windows.
- If in the restore panel, the exit command will exit the restore panel and restart the computer.
See more:
- Order bitsadmin getnotifycmdline, getnotifyflags, getnotifyinterface
- Bitsadmin getmodificationtime and bitsadmin getnoprogresstimeout command
- Bitsadmin getfilestransferred and bitsadmin commands getminretrydelay
Discover more
Share by
David Pac
Update 26 May 2019
You should read it
- The exit () function in C
- Del command in Windows
- Run remote commands on Cisco routers from the computer
- How to exit full screen mode on Windows
- MS Access 2003 - Lesson 4: Exit Access
- The Quiet Details That Make a Sports Betting Platform Feel Reliable
- Instructions on creating toy set images with ChatGPT AI
- How are AI agents changing the journalism industry?
- Learn about Decibel (dB) in computer networks
- Expand command in Windows
- The reg command restores and reg saves in Windows