End the current Command Prompt session and close the window.
exit [/b] [
exit has the same effect as closing the
Command Prompt window with the [x] button.
exit accepts the following options:
exitis used from within a batch file, it will close the current Command Prompt window. Specify
/bto exit the batch file but leave
Specifies a numerical “exit code” number that is passed to the application or process that launched the Command Prompt or started the batch file.
Exitcodeis typically used when one batch file runs another batch file and wishes to report to the “parent” batch file whether successful or not.
If you start a new Command Prompt session by typing
cmd in an open Command Prompt window,
exit will end that session. However, since the
“parent” session is still active,
the window won’t close until you type