How to close or exit the Windows command line

Updated: 12/29/2017 by Computer Hope
Windows DOS command prompt window

To close or exit the Windows command line window type exit and press Enter.

Tip

The exit command can also be placed in a batch file.

Alternatively, if the window is not a fullscreen you can click the X close button in the top-right corner of the window.

You can also use the universal shortcut key Alt+F4 to close a Command Prompt window.