Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


Published: April 17, 2012

Updated: April 17, 2012

Applies To: Windows 7, Windows 8, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Vista

Exits the Cmd.exe program (the command interpreter) or the current batch script.

For examples of how to use this command, see Examples.

exit [/b] [<ExitCode>]


Parameter Description


Exits the current batch script instead of exiting Cmd.exe. If executed from outside a batch script, exits Cmd.exe.


Specifies a numeric number. If /b is specified, the ERRORLEVEL environment variable is set to that number. If you are quitting Cmd.exe, the process exit code is set to that number.


Displays help at the command prompt.

To close the command interpreter, Cmd.exe, type:


Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft