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

Jean-François Pillou - Founder of CCM
Better known as Jeff, Jean-François Pillou is the founder of CommentCaMarche.net. He is also CEO of CCM Benchmark and digital director at the Figaro Group.

Learn more about the CCM team