Author Topic: Pressing F7 in the Command Prompt Lists Previously Entered Commands  (Read 2845 times)

Offline javajolt

  • Administrator
  • Hero Member
  • *****
  • Posts: 35122
  • Gender: Male
  • I Do Windows
    • windows10newsinfo.com
Did you know that pressing the F7 key while using the Windows command prompt will display a box containing a list of previously typed commands? If not, then these tips may help you use the Command Prompt more efficiently.

This feature was originally part of the DOSKEY program that was introduced in MS-DOS and was loaded as a TSR (Terminate and stay resident program). While the program is still available to this day, much of its functionality is now built directly into the Windows command prompt.


Command Prompt Command History

You can navigate through this list using the up and down arrow keys on the keyboard.

When the commands are stored in the history they are also associated with an index number. You can then use the F9 key to cause the Command Prompt to ask you what command number you wish to enter. By entering a number and pressing enter, the command will be executed.  For example, using the commands illustrated in the window above, if you press F9 and entered the number 10, it would execute the dir command.


Enter Command Number

In addition to opening a list of entered commands, you can also clear the history by pressing Alt + F7. This keyboard combination will clear all of the stored history and F7 will not work again until after another command is entered.

Last, but not least, another useful feature that you can perform in the command prompt is to use the up and down arrow keys to go through a list of previously entered commands. This makes it easy to execute the same command over and over by typing the command, pressing enter, pressing the up arrow so the command appears again, and pressing enter again. You can repeat this as many times as you want the command to run.

source