DOSKEY

From Wikipedia, the free encyclopedia
  (Redirected from DOSKey)
Jump to: navigation, search

DOSKEY is a utility for DOS and Microsoft Windows that adds command history, macro functionality, and improved editing features to the command line interpreters COMMAND.COM and CMD.EXE. It was included as a TSR program with MS-DOS and PC DOS versions 5 and later, Windows 9x and Windows XP or later.

In early 1989 functionality similar to DOSKEY was introduced with DR-DOS 3.40 with its HISTORY CONFIG.SYS directive. This enabled a user-configurable console input history buffer and recall as well as pattern search functionality on console driver level, that is, fully integrated into the operating system and transparent to running applications. In summer 1991 DOSKEY was introduced in MS-DOS/PC DOS 5.0 in order to provide some of the same functionality. DOSKEY also added a macro expansion facility, which, however, required special support to be implemented in applications like command line processors before they can take advantage of it. Starting with Novell DOS 7 in 1993 the macro capabilities were provided by an external DOSKEY command as well. In order to also emulate DOSKEY's history buffer functionality under DR-DOS, the DR-DOS DOSKEY works as a frontend to the resident history buffer functionality, which remained part of the kernel in DR-DOS.

In current Windows NT-based operating systems DOSKEY's functionality is built into CMD.EXE, although the DOSKEY command is still used to change its operation.

Usage[edit]

DOSKEY allows the use of several command switches:

DOSKEY [/switch ...] [macroname=[text]]

/REINSTALL Installs a new copy of DOSKEY.
/LISTSIZE=[size] Sets size of command history buffer to size.
/MACROS Displays all DOSKEY macros.
  • /MACROS:ALL
Displays all DOSKEY macros for all executables which have DOSKEY macros.
  • /MACROS:[executable name]
Displays all DOSKEY macros for the given executable.
/HISTORY Displays all commands stored in memory.
/INSERT Specifies that new text typed is inserted in old text.
/OVERSTRIKE Specifies that new text overwrites old text.
/EXENAME=exename Specifies the executable.
/MACROFILE=filename Specifies a file of macros to install.
/APPEDIT (undocumented - since MS-DOS 7)
/COMMAND (undocumented - since MS-DOS 7)
/PERMANENT (undocumented - since MS-DOS 7)
/SCRSIZE (undocumented - since MS-DOS 7)
/XHISTORY (undocumented - since MS-DOS 7)
[macroname] Specifies a name for a macro created.
[text] Specifies commands to record.

During a DOSKEY session, the following keyboard shortcuts can be used:

Up and Down Recall commands
Esc Clears command line
Ctrl-Home Clears command line from the cursor to the beginning of the line.
Ctrl-End Clears command line from the cursor to the end of the line.
F7 Displays command history
Alt-F7 Clears command history
F8 Searches command history
F9 Selects a command by number
Alt-F10 Clears macro definitions

DOSKEY implements support for command macros, a simple text-substitution facility which is used somewhat like command line aliases in other environments.

$T Command separator. Allows multiple commands in a macro.
$1–$9 Batch parameters. Equivalent to %1-%9 in batch programs.
$* Symbol replaced by everything following the macro name on command line.

Alternatives[edit]

The absence of a command history in COMMAND.COM was a serious inconvenience from the earliest versions of MS-DOS. Numerous third-party programs have been written to address the issue; many were available long before Microsoft supplied DOSKEY. Some of these also provide additional editing capabilities lacking in DOSKEY, such as filename completion, for example JP Software's 4DOS and NDOS. Some of the better-known DOSKEY alternatives are Chris Dunford's CED, Sverre Huseby's DOSED, Ashok Nadkarni's CMDEDIT, Steven Calwas's ANARKEY, Eric Tauck's TODDY, and Paul Houle's enhanced DOSKEY.

See also[edit]

External links[edit]