Jump to content

Pressing F7 in the Command Prompt Lists Previously Entered Commands


zoran

Recommended Posts

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.

 

When the command prompt is open and you have typed some commands, you can press the F7 key on your keyboard to display a list of all commands that were executed. This list will only contain the commands executed by this particular instance of the command prompt, and once you close the windows, the history will be removed.

 

f7-cmd-history.jpg

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.jpg

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.

 

This can be useful when watch a folder for the progress of deleted files, transferring files, etc.

The command prompt is a powerful tool and understanding how to use it to its fullest potential can make it much easier to administer a Windows machine.

 

source  and thanks to  Andy Sterland

Link to comment
Share on other sites


  • Views 524
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...