Stop the Command Prompt from Automatically Closing

Ask a question
If you have noticed that your command prompt often automatically shuts down, you may find this annoying or even worrisome.

This FAQ will show you how to prevent this from happening.

Prevent the Command Prompt from Closing Automatically

Press Windows key + R to open the Run window.

Launch the command prompt by typing
 cmd /K


Adding / K after the command keeps the window open. You can, then, close the window manually when you no longer need it to be open.

quka - Shutterstock.com
Jean-François Pillou

CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Learn more about the CCM team