Dos - DOSKEY (command history)

Card Puncher Data Processing


Doskey is an utility that:

  • edits command lines,
  • recalls Windows commands,
  • and creates macros.


  [/MACROS[:ALL | :exename]]
Switches Description
/REINSTALL Installs a new copy of Doskey.
/LISTSIZE=size Sets size of command history buffer.
/MACROS Displays all Doskey macros.
/MACROS:ALL Displays all Doskey macros for all executables which have Doskey macros.
/MACROS:exename 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.

Hot Key

Keyboard - Key

  • UP and DOWN ARROWS recall commands;
  • ESC clears command 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.


The following are some special codes in Doskey macro definitions:

Variable Description
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 macro name on command line.

How to

display command history

doskey /history
:: or
:: Press F7

search command history

Example with the following command history buffer:

dir /?
dir /A
dir /B
dir /C
dir /L
dir /N
dir /B
dir /OD

By typing “di” and pressing F8:

  • for the first time, you will get:
    dir /OD
  • for the second time, you will get:
    dir /B
  • etc…

Documentation / Reference

Discover More
Idea Antlr Right Click Options
Antlr - Installation (Version 4)

Installation of Antlr tool on . on Idea Create a grammar file with the extension g4 and Idea should propose you to install the Antlr plugin Right click on your g4 file, you should see the...
Card Puncher Data Processing
Dos - Getting Started

command history (F7, F8, ...)
Card Puncher Data Processing
Dos - History


Share this page:
Follow us:
Task Runner