Tip 22: Command Prompt Keys

The Command Processor offered in Windows NT/2000/XP (cmd.exe, not command.exe, which is just a version of the MS-DOS command processor incorporated in the product) has always provided the ability to use the "up-arrow" and "down-arrow" keys to cycle through any previously entered commands.

This Windows Command Prompt however, also offers some nifty, little known "shortcut keys" that enhance the use of the command prompt.

Below is a list of functions associated with the functions keys F1 to F9 when working from the Command Prompt:

F1 Repeats the letters of the last command line, one by one
F2 Displays a dialog asking user to "enter the char to copy up to" of the last command line
F3 Repeats the last command line
F4 Displays a dialog asking user to "enter the char to delete up to" of the last command line
F5 Goes back one command line
F6 Enters the traditional CTRL+Z (^z)
F7 Displays a menu with the command line history
F8 Cycles back through previous command lines (beginning with most recent)
F9 Displays a dialog asking user to enter a command number, where 0 is for first command line entered
Note: The buffer allows a maximum of 50 command lines. After this number is reached, the mechanism will "wrap around" and the lines in the buffer will be replaced in sequence, starting with the first line in the buffer.

Works on Windows NT / Windows 2000 / Windows XP