DOSKEY


title: "DOSKEY" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["external-dos-commands", "os/2-commands", "reactos-commands", "utility-software-for-windows", "windows-administration"] topic_path: "technology/operating-systems" source: "https://en.wikipedia.org/wiki/DOSKEY" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::data[format=table title="Infobox software"]

FieldValue
nameDOSKEY
screenshotReactOS-0.4.13 doskey command 667x434.png
captionThe ReactOS doskey command
developerMicrosoft, IBM, Novell, ReactOS contributors
released
operating systemMS-DOS, PC DOS, OS/2, eComStation, ArcaOS, Novell DOS 7, DR-DOS, Windows, ReactOS
platformCross-platform
genreCommand
website
::

| name = DOSKEY | logo = | screenshot = ReactOS-0.4.13 doskey command 667x434.png | screenshot size = | caption = The ReactOS doskey command | developer = Microsoft, IBM, Novell, ReactOS contributors | released = | latest release version = | latest release date = | operating system = MS-DOS, PC DOS, OS/2, eComStation, ArcaOS, Novell DOS 7, DR-DOS, Windows, ReactOS | platform = Cross-platform | genre = Command | license = | website = DOSKEY is a command in DOS, OS/2, Windows, and ReactOS that adds command history, macro functionality, and improved editing features to the [COMMAND.COM](command-com) and [cmd.exe](cmd-exe) command-line interpreter shells.

History

The command was included as a terminate-and-stay-resident program with MS-DOS and PC DOS versions 5 and later, then Windows 9x, and finally Windows 2000 and later.

In early 1989, functionality similar to DOSKEY was introduced with DR-DOS 3.40 with its [HISTORY](history-config-sys-directive) CONFIG.SYS directive. This enabled a user-configurable console input history buffer and recall as well as pattern search functionality on the console driver level, that is, fully integrated into the operating system and transparent to running applications. In the summer of 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, though special support was required before applications such as command line processors could 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 the DOSKEY history buffer functionality under DR-DOS, the DR-DOS DOSKEY worked as a front end to the resident history buffer functionality, which remained part of the kernel.

DOSKEY has also been included in IBM OS/2 Version 2.0.

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

The DOSKEY command is not available in FreeDOS, which has such features built into the command interpreter.

Usage

Command switches

DOSKEY allows the use of several command switches:

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

; :Installs a new copy of DOSKEY.

;[size] :Sets size of command history buffer to size.

; :Displays all DOSKEY macros. :; ::Displays all DOSKEY macros for all executables which have DOSKEY macros. :;[executable name] ::Displays all DOSKEY macros for the given executable.

; :Displays all commands stored in memory.

; :Specifies that new text typed is inserted in old text.

; :Specifies that new text overwrites old text.

;exename :Specifies the executable.

;filename :Specifies a file of macros to install.

; :(undocumented - since MS-DOS 7)

; :(undocumented - since MS-DOS 7)

; :(undocumented - since MS-DOS 7)

; :(undocumented - since MS-DOS 7)

; :(undocumented - since MS-DOS 7)

;[macroname] :Specifies a name for a macro created.

;[text] :Specifies commands to record.

Keyboard shortcuts

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

; and :Recall commands

; :Clears command line

; :Clears command line from the cursor to the beginning of the line.

; :Clears command line from the cursor to the end of the line.

; :Displays command history

; :Clears command history

; :Searches command history

; :Selects a command by number

; :Clears macro definitions

Command macros

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

; :Command separator. Allows multiple commands in a macro.

;– :Batch parameters. Equivalent to - in batch programs.

; :Symbol replaced by everything following the macro name on command line.

Alternatives

The absence of a command history in COMMAND.COM was a serious inconvenience ever since 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 them, including JP Software's 4DOS and NDOS, also provide additional editing capabilities lacking in DOSKEY, such as filename completion. Some of the better-known DOSKEY alternatives are 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 enhanced DOSKEY written by Paul Houle.

Paul Houle's Enhanced DOSKEY is designed to be an enhanced drop-in replacement for the DOSKEY.COM that ships with MS-DOS and Windows 9x/Windows Me. It also has a smaller disk and memory-resident footprint. The primary added feature is command and file "auto-completion" via the Tab key. Version 2.5, released in 2014, also adds full support for long filenames (LFN).

References

References

  1. "JaTomes Help - OS/2 Commands".
  2. (11 September 2009). "Doskey {{!}} Microsoft Docs".
  3. (2 November 2021). "Reactos/Reactos".
  4. (2003). "Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition". [[Microsoft Press]].
  5. (1999). "Windows 98 in a Nutshell: A Desktop Quick Reference". [[O'Reilly Media.
  6. Frisch, Æleen. (2001). "Windows 2000 Commands Pocket Reference". [[O'Reilly Media.
  7. [http://www.tavi.co.uk/os2pages/pdf/gg243731_OS2_V2_0_Vol_2_DOS_and_Windows_Environment.pdf OS/2 2.0 Redbooks Volume 2 - DOS and Windows Environment (GG24-3731)]
  8. "FreeDOS command: doskey".
  9. "Enhanced DOSKEY.com -- with auto-completion Paul Houle".

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

external-dos-commandsos/2-commandsreactos-commandsutility-software-for-windowswindows-administration