A few words of thanks would be greatly appreciated.

Windows 7: keeping a command prompt window opened!

A command can be run in the Windows 7 operating system through the run tab in the start menu. Commands can be directly entered along with the parameters to be executed. The command window in Windows operating systems closes as soon as the command is executed. This makes it very difficult to check the logs or messages printed during the execution of the command. To keep the command prompt window open, a parameter needs to be defined through the cmd command. Using the /k parameter with all commands, the command prompt window remains open until it is closed by the user.

In the Start menu and the Run tab you can insert the name of a program or a command to run under Windows 7.

These commands are different from each other and of different types: Shell, Windows or DOS.


Often, when we enter a particular command, it is not possible to see the results, since the console will close once the command is executed.


  • It is possible to keep the command prompt window open, simply by inserting the parameter before the name of the command > cmd /k <.
  • Don't forget to leave a space between "cmd" and "/k"
  • Here is an example:

Use command in Run> ipconfig / all

The window disappears suddenly.

Executing a command with the parameter: cmd /k

Then insert this command: cmd /k ipconfig / all


A few words of thanks would be greatly appreciated.

Ask a question
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.

Original article published by . Translated by deri58. Latest update on by Virginia Parsons.

This document, titled "Windows 7: keeping a command prompt window opened!," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).

1 Comment