DOSKey

From Wikipedia, the free encyclopedia

DOSKey is a utility for MS-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, and with Microsoft's Windows 95/98/Me.

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.

Contents

[edit] Usage

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 you type 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.
[macroname] Specifies a name for a macro you create.
[text] Specifies commands you want 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. DOSKey macro definitions can use the following special codes:

$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.

[edit] Alternatives

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. Some of the better-known DOSKey alternatives are Chris Dunford's ced, Sverre Huseby's dosed, Ashok Nadkarni's cmdedit, Steven Calwas's Anarkey, and Eric Tauck's Toddy.

[edit] See also

[edit] External links

 This article related to software which runs on Microsoft Windows is a stub. You can help Wikipedia by expanding it.