ARCHIVED: What is DOSKEY?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

DOSKEY is a program in DOS versions 5 and higher which allows you to recall and edit DOS commands from the command line. This can be beneficial when you are following instructions to manually back up the registry before getting rid of a virus, or when doing other Windows updates which require repetitive steps.

In Windows NT, 2000, and XP, the 32-bit version of the DOS command interpreter (%systemroot%\system32\cmd.exe) has DOSKEY functionality built in, and is the preferred method for accessing a command prompt. Although the older version of the command interpreter (%systemroot%\system32\command.com) is included for compatibility, it is not recommended for normal use and does not include DOSKEY functionality.

For Windows 95, 98, and Me, you can put the following line in your AUTOEXEC.BAT file to load DOSKEY every time you start your computer:

  c:\dos\doskey.com

Alternately, you can load it into high memory with this line:

  lh c:\dos\doskey.com

You can also enter either of these lines at the DOS prompt to load DOSKEY, although with this method the program will no longer be active after you restart your computer. Also, you won't be able to recall commands you entered before running DOSKEY.

In Windows 95, 98, and Me the path to DOSKEY is:

  C:\Windows\Command\doskey.com

To run DOSKEY while in Windows 95, 98, or Me, open a command prompt (MS-DOS prompt) window by clicking the Start button and selecting Run.... In the window that opens, type command and click OK. In the command prompt window that opens, enter doskey. You will see the message DOSKEY Installed.

Here are some of the keys that DOSKEY recognizes:

Key Action
up arrow
display the previous command in the history buffer
down arrow
display the next command in the history buffer
left arrow move one character left
right arrow move one character right
Home
move to the beginning of the line
End move to the end of the line
Ctrl-left arrow move one word left
Ctrl-right arrow move one word right
Ctrl-Home
delete to the beginning of the line
Ctrl-End delete to the end of the line
Esc delete the entire line
Insert
toggle between insert and overwrite mode
F7
display all previous commands in the history buffer
Alt-F7 clear the history buffer
[characters]F8
display buffer commands starting with [characters]
[n]F9
display the [n]th command in the history buffer
Page Up
display the first command in the history buffer
Page Down
display the last command in the history buffer

DOSKEY also allows you to create macros and has several command-line options. For more information, at the DOS prompt, enter:

  doskey /?

This article was adapted from the Instant Reference Card #15 on page 237 of the August 1991 issue of PC World.

This is document aers in the Knowledge Base.
Last modified on 2018-01-18 09:11:15.