Do you know the “proper” way to close the command prompt?
If your answer was “yes, press the x button” then read on to learn how to close the command prompt window like a professional.
Open Command Prompt as Administrator
![](https://i0.wp.com/rapidlydigital.com/wp-content/uploads/2023/01/cmdadmin.webp?resize=824%2C683&ssl=1)
1) Press the Windows Key
2) Type cmd and press return
3) Right Click the Command Prompt icon and select ‘ Run as Administrator’
Type the command
In the command prompt window enter the below command and press return
exit
And as if by magic, the command prompt window will close
![](https://i0.wp.com/rapidlydigital.com/wp-content/uploads/2021/09/image-5.png?resize=975%2C510&ssl=1)
exit command options
The exit command has a few additional options that are primarily intended to be used if executing a batch script or applying an error level
EXIT [/B] [exitCode]
/B specifies to exit the current batch script instead of
CMD.EXE. If executed from outside a batch script, it
will quit CMD.EXE
exitCode specifies a numeric number. if /B is specified, sets
ERRORLEVEL that number. If quitting CMD.EXE, sets the process
exit code with that number.