Arp
At
Cls
Cmd
Fc
For
Ftp
If
Lpq
Lpr
Mmc
Rcp
Reg
Rem
Rsh
Rsm
SC
Set
Ver
Vol
Expand Minimize
2 out of 9 rated this helpful - Rate this topic

Exit

Exits the current batch script or the Cmd.exe program (that is, the command interpreter) and returns to the program that started Cmd.exe or to the Program Manager.

Syntax

exit [/b] [ExitCode]

Parameters

/b   : Exits the current batch script.

ExitCode   : Specifies a numeric number.

/?   : Displays help at the command prompt.

Remarks

  • If you use /b outside of a batch script, it will exit Cmd.exe.

  • If you use /b, Cmd.exe sets the ERRORLEVEL to the specified ExitCode. If you exit Cmd.exe, Cmd.exe sets the process exit code with the specified ExitCode.

Formatting legend

Format

Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Cmd

Command-line reference A-Z

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.