How can I configure the command line history, DOSKEY?

A. In olden DOS days a utility was available, DOSKEY.EXE, which enabled the user to cycle through previous commands. In NT this is enabled by default and you can cycle through old commands however DOSKEY has other abilities.

To clear the current command line history use command:

doskey /reinstall

You can also optionally tell it how many old commands to keep with the /listsize parameter

doskey /reinstall /listsize=50

would keep 50 old commands.

Its also possible to create macros which allow you to assign a complex command to a single word, for example

doskey dird=dir /ad

Would create a macro dird which only lists directories.

Its also possible to assign a macro to a specific command level application using the /exename switch, for example

doskey /exename=nslookup.exe sets=server

Entering sets in NSLOOKUP would now set the server to To view current macros for an image use

doskey /exename=<exe name> /macros, for example

C:\&gt; <b> doskey /exename=nslookup.exe /macros</b><br>

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.