Usage of doskey

DOSKey allows the use of several command switches:

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

/REINSTALLInstalls a new copy of DOSKey.
/LISTSIZE=[size]Sets size of command history buffer to size.
/MACROSDisplays 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.
/HISTORYDisplays all commands stored in memory.
/INSERTSpecifies that new text you type is inserted in old text.
/OVERSTRIKESpecifies that new text overwrites old text.
/EXENAME=exenameSpecifies the executable.
/MACROFILE=filenameSpecifies 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 DownRecall commands
EscClears command line
Ctrl-HomeClears command line from the cursor to the beginning of the line.
Ctrl-EndClears command line from the cursor to the end of the line.
F7Displays command history
Alt-F7Clears command history
F8Searches command history
F9Selects a command by number
Alt-F10Clears 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:

$TCommand separator. Allows multiple commands in a macro.
$1-$9Batch parameters. Equivalent to %1-%9 in batch programs.
$*Symbol replaced by everything following the macro name on command line.

 copy from: http://en.wikipedia.org/wiki/DOSKey

原文地址:https://www.cnblogs.com/zzj8704/p/1654789.html