Windows 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. Pressing the F7 key to open a list of previously typed commands will display a history of executed commands. 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. This makes it easy to execute the same command over and over by typing the command, pressing enter.
Source: https://www.bleepingcomputer.com/news/microsoft/pressing-f7-in-the-command-prompt-lists-previously-entered-commands/

