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:

  1. Windows 95
  2. Windows 98
  3. Windows ME
  4. Windows NT
  5. Windows 2000
  6. Windows XP
  7. Windows Vista
  8. Windows 7
  9. Windows 8
  10. 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 
  1. When in another command interpreter, exit will exit the new command interpreter and return to the original command interpreter.
  2. When you import DOS from Windows, the exit command will return you to Windows.
  3. If in the restore panel, the exit command will exit the restore panel and restart the computer.

See more:

  1. Order bitsadmin getnotifycmdline, getnotifyflags, getnotifyinterface
  2. Bitsadmin getmodificationtime and bitsadmin getnoprogresstimeout command
  3. Bitsadmin getfilestransferred and bitsadmin commands getminretrydelay
3.5 ★ | 2 Vote