How to Freeze a CMD Window Output

By Kevin Lee

Control your CMD window output using a switch command.
i Visage/Stockbyte/Getty Images

Your business computer’s CMD window allows you to communicate with the operating system, execute system commands and view responses without using the Windows graphical user interface. For example, if you type the "dir" command in the CMD window, Windows displays the names of the files and subfolders that reside in one of your folders. This information can whiz by rapidly if your folder contains dozens or hundreds of files. When you need to use the CMD window to execute commands and view their output, you can add a simple switch to your command to freeze the output before displaying additional screens of information.

Click the Windows Start button and type "cmd" in the Search box. When the Cmd.exe icon appears, click it to open the CMD window.

Type “dir” – without the quotes – and press “Enter.” The window displays the list of files that reside in the current folder. The current folder is the one whose name appears to the left of the command prompt character.

Type “dir /p” and press “Enter” again. The window displays only the filenames that fit within the CMD window. This happens because the /p switch added to the end of the command causes the window to pause -- or freeze -- after displaying a screen full of information.

Press “Enter” to view the next screen of filenames. As you continue to press “Enter,” the window shows you additional screens containing the names.


While freezing the CMD window can be useful when you need to view a small amount of output, it may take a while to move through a list of results if it requires hundreds of screens to display them. Another way to view the output of a command is to route it to a file by placing "> myfile.txt" -- without the quotes -- after your command. Replace "myfile.txt" with the name of the file you want to hold the results. When you run the command, Windows sends the output to that file without displaying it in the CMD window.