[/ insert | / overstrike] [/ exename =] [/ macrofile =] [= []]
Doskey.exe is always available for all character-based interactive programs (such as program debugger or file transfer program), and it maintains command history buffers and macros for each program to start. You cannot use doskey command line options from a program. You must run the doskey command line options before you start a program. The key assignment for the program overrides the key assignment for doskey.
To recall a command, you can use any of the following keys after you start Doskey.exe. If you use Doskey.exe in a program, the main task of that program will take precedence.
Key Description NAME NAME UP Recall the command you used before the command that is being displayed. DOWNLOAD EACH Call the command you used after the command that is being displayed. PAGE UP Recall the first command you used in the current session. PAGE DOWN Recall the most recent command you used in the current session.With Doskey.exe, you can edit the current command line. If you use Doskey.exe in a program, the key assigned to that program will take precedence and some Doskey.exe editing keys may not work.
The following table lists the doskey editing keys and their functions.
Key or key combination Description DESCRIPTION LEFT NAME Move the cursor back to a character. EACH NAME MUST Move the cursor forward one character. CTRL + LEFT NAME LEFT Move the cursor back to a word. CTRL + EACH NAME MUST Move the cursor forward a word. HOME Move the cursor to the beginning of the line. END Move the cursor to the end of the line. ESC Delete the command from the screen. F1 Copy a character from a column in the template into the same column in the Command Prompt window. (Template is the cache that contains the last command you entered). F2 Search the transition in the template for the next key you enter, after you press F2. Doskey.exe inserts text from the template - maximum, but not including, the character you specify. F3 Copy the rest of the template into the command line. Doskey.exe starts copying the characters from the position in the template corresponding to the location indicated by the cursor on the command line. F4 Delete all characters from the current cursor position, but do not include the characters you entered after you press F4. F5 Copy the template to the current command line. F6 Set the file end character ( CTRL + Z ) at the current cursor position. F7 Display (in the dialog box) all commands for the current program are stored in memory. Use the up arrow key and the down arrow key to select the command you want, and press ENTER to run the command. You can also note the sequence number in front of the command and use this number along with the F9 key . ALT + F7 Delete all the stored commands in memory for the current history buffer. F8 Displays all the commands in the history buffer starting with the characters in the current command. F9 Remind you to enter a number for the history buffer command, and then display the command associated with the number you specified. Press ENTER to run the command. To display all their numbers and related commands, press F7. ALT + F10 Delete all macro descriptions.Some interactive programs are character-based, such as debugging programs or file transfer programs (File transfer programs - FTP) that automatically use Doskey.exe. To use Doskey.exe, a program must be a driver and use the input with the buffer. The key assignment for the program overrides the key assignment for doskey. For example, if the program uses the F7 key for a function, you cannot get the doskey command history in a pop-up window.
With Doskey.exe, you can maintain the command history for each program you start or repeat. You can edit the previous commands at the program prompt, and start the doskey macro created for the program. If you exit and then restart a program from the same Command Prompt window, the command history from the previous session of the program will be available.
You must run Doskey.exe before you start a program. You cannot use the doskey command-line options from the program's command prompt, even if the program has a shell command.
If you want to customize the way Doskey.exe works with a program and create a doskey macro for that program, you can create a batch program to modify Doskey.exe and start the program.
If you press the INSERT key , you can enter the text on the doskey command line in the middle of the existing text without completely replacing the text. However, after you press ENTER, Doskey.exe will return your keyboard to Replace mode . You must press INSERT again to return to Insert mode .
Use / insert to switch your keyboard to Insert mode every time you press ENTER. Your keyboard is effective in Insert mode until you use / overstrike. You can temporarily return to Replace mode by pressing the INSERT key , but after you press ENTER, Doskey.exe will return your keyboard in Insert mode .
The cursor changes shape when you use the INSERT key to change from one mode to another.
You can use Doskey.exe to create macros that perform one or more commands. The following table lists the special characters that you can use to control command operations when you define macros.
Character Description $ G or $ g Redirects output. Use one of these special characters to send the output to the device or file instead of the screen. This character is equivalent to the navigation icon for the output ( > ). $ G $ G or $ g $ g Connect the output to the end of the file. Use one of these double characters to connect the output to an existing file instead of replacing the data in the file. These double characters are equivalent to the append navigation icon for the output ( >> ). $ L or $ l Input redirection. Use one of these special characters to read input from the device or file instead of from the keyboard. This character is equivalent to the navigation symbol for input ( < ). $ B or $ b Send macro output to a command. These special characters are equivalent to using the ** character . $ T or $ t Split commands. Use one of these special characters to separate commands when you create macros or type commands on the doskey command line . These special characters are equivalent to using the ampersand ( & ) on the command line. $$ Specifies the dollar character ( $ ). $ 1 to $ 9 Present any command line information you want to specify when you run the macro. Special characters from $ 1 to $ 9 are batch parameters that allow you to use different data on the command line every time you run the macro. The $ 1 character in the doskey command is similar to the character % 1 in the batch program. $ * Shows all command line information you want to specify when you enter the macro name. Special character $ * is an alternative parameter similar to batch parameters from $ 1 to $ 9, with one important difference: Everything you type in the command line after the macro is replaced for $ * in macro.To run the macro, enter the macro name at the command prompt, starting from the first position. If the macro is determined by $ * or any batch parameter of $ 1 to $ 9, use a space to parse the parameters. You cannot run doskey macro from a batch program.
To delete a macro, enter:
doskey =
Command / macro and / or history options are useful for creating batch programs to save macros and commands. For example, to store all of the current doskey macros, enter:
doskey /macros > macinit
To use macros stored in Macinit, enter:
doskey /macrofile=macinit
To create a batch program named Tmp.bat, which contains recently used commands, enter:
doskey /history> tmp.bat
To specify macros with multiple commands, use $ t to separate the commands, as follows:
doskey tx=cd temp$tdir/w $*
In the previous example, the TX macro changes the current directory to Temp and then displays the directory list in a wide display format. You can use $ * at the end of the macro to append other command line options to dir when you run TX.
The following macro uses the batch parameter for the new directory name:
doskey mc=md $1$tcd $1
Macro creates a new folder and then changes the new folder from the current directory.
To use the previous macro to create and change it to a folder called Books, enter:
mc books
How to create the doskey macro for the program named Ftp.exe, including / exename as follows:
doskey /exename=ftp.exe go=open 172.27.1.100$tmget *.TXT c:reports$tbye
To use the previous macro, start FTP. At the FTP prompt, enter:
go
FTP runs the commands open, mget and bye.
To create a disk format macro quickly and unconditionally, enter:
doskey qf=format $1 /q /u
To format the disk quickly and unconditionally in drive A, enter:
qf a:
To delete a macro named vlist, enter:
doskey vlist =
See more: