DOSKEY
Cross-platform | |
Type | Command |
---|---|
Website | docs |
DOSKEY is a
COMMAND.COM
and cmd.exe
History
The command was included as a
and later.In early 1989, functionality similar to DOSKEY
was introduced with
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.[7]
In current
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.[8]
Usage
Command switches
DOSKEY allows the use of several
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.
Keyboard shortcuts
During a DOSKEY session, the following keyboard shortcuts can be used:
- ↑ and ↓
- 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
Command macros
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
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
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[9] 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).
See also
References
- ^ "JaTomes Help - OS/2 Commands". Archived from the original on 2019-04-14. Retrieved 2019-07-28.
- ^ "Doskey | Microsoft Docs". 2009-09-11.
- ^ "Reactos/Reactos". GitHub. 2021-11-02.
- ISBN 0-7356-1812-7.
- ISBN 978-1565924864.
- ISBN 978-0-596-00148-3.
- ^ OS/2 2.0 Redbooks Volume 2 - DOS and Windows Environment (GG24-3731)
- ^ "FreeDOS command: doskey". Archived from the original on 2011-11-07.
- ^ "Enhanced DOSKEY.com -- with auto-completion Paul Houle".
Further reading
- Cooper, Jim (2001). Special Edition Using MS-DOS 6.22, Third Edition. ISBN 978-0789725738.
- Dyson, Peter (1995). Mastering OS/2 Warp. ISBN 978-0782116632.
- Stanek, William R. (2008). Windows Command-Line Administrator's Pocket Consultant, 2nd Edition. ISBN 978-0735622623.
- Paul, Matthias R. (1997-07-30). NWDOS-TIPs — Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds. MPDOSTIP (in German) (3 ed.). Archived from the original on 2016-11-04. Retrieved 2014-08-06. (NB. NWDOSTIP.TXT is part of MPDOSTIP.ZIP, maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.)