Jump to content

DOSKEY

From Alfawiki
DOSKEY
Company typeCommand line utility
IndustrySoftware
Founded1991
Headquarters
N/A
ProductsCommand history, macros, command-line editing

DOSKEY is a command utilized in DOS, OS/2, Windows, and ReactOS environments that enhances the COMMAND.COM and cmd.exe command-line interfaces by providing command history, macro capabilities, and improved editing options.

History

DOSKEY was introduced as a terminate-and-stay-resident program starting with MS-DOS and PC DOS version 5, continuing through Windows 9x, Windows 2000, and later editions.

In 1989, DR-DOS 3.40 incorporated comparable functionality through the HISTORY directive, which offered a configurable input history buffer and pattern search directly within the operating system. The DOSKEY command itself debuted in MS-DOS/PC DOS 5.0 in 1991, adding support for macros that required application-level integration. From 1993 onward, with Novell DOS 7, macro features were implemented via an external DOSKEY utility. In DR-DOS systems, DOSKEY served as a front-end interface to the resident kernel-level history buffer.

DOSKEY was also part of IBM OS/2 Version 2.0.

In contemporary Windows NT-based platforms, the command-line interpreter CMD.EXE incorporates DOSKEY's functionality natively, although the standalone DOSKEY command remains available for user customization.

This command is not included in FreeDOS, where similar features are embedded directly into the shell.

Command switches

DOSKEY offers various command switches as follows:

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

Loads a new instance of DOSKEY.
[size]
Defines the size of the command history buffer as size.
Lists all macros currently defined by DOSKEY.
Displays macros associated with every executable.
[executable name]
Shows macros specific to a given executable.
Outputs all commands stored in history.
Inserts specified text into existing command lines.
Replaces existing text with new content.
exename
Identifies the target executable name.
filename
Imports macros from a designated file.
, , , ,
(undocumented switches present since MS-DOS version 7)
[macroname]
Establishes a macro identifier.
[text]
Specifies the commands recorded within the macro.

Keyboard shortcuts

Within DOSKEY sessions, these keyboard shortcuts facilitate enhanced command-line editing:

and
Navigate through previously entered commands
Cleans the entire current command line
Removes text from cursor position to line start
Erases text from cursor position to line end
Shows the list of past commands
Clears all saved command history
Performs a search within command history
Selects a specific command by its number
Deletes all macro definitions

Command macros

DOSKEY enables creation of command macros that function similarly to aliases by substituting text:

Separates multiple commands within a single macro definition.
–
Represents batch parameters analogous to – in batch scripts.
Denotes all arguments following the macro invocation.

Alternatives

Before DOSKEY's availability, the absence of built-in command history in COMMAND.COM led to numerous third-party tools. Prominent alternatives such as JP Software's 4DOS and NDOS provide advanced features like filename tab completion, which DOSKEY lacks. Other notable replacements include Jack Gersbach's DOSEDIT, 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 version of DOSKEY.

Paul Houle's Enhanced DOSKEY acts as a compact substitute for MS-DOS and Windows 9x/Windows Me's native DOSKEY.COM, boasting reduced disk and memory usage. Its chief commercial benefit lies in providing command and file auto-completion via the Tab key. The 2014 release of version 2.5 introduced comprehensive support for long filenames (LFN), enhancing compatibility with modern file systems.

See also

Further reading

  • (NWDOSTIP.TXT, included in MPDOSTIP.ZIP, was maintained up to 2001 and widely circulated. The provided link directs to an HTML format of the document.)

External links