How can I configure the command line history, DOSKEY?

John Savill

April 27, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. In olden DOS days a utility was available, DOSKEY.EXE, whichenabled the user to cycle through previous commands. In NT this is enabled bydefault and you can cycle through old commands however DOSKEY has otherabilities.

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 /listsizeparameter

doskey /reinstall /listsize=50

would keep 50 old commands.

Its also possible to create macros which allow you to assign a complexcommand 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 applicationusing the /exename switch, for example

doskey /exename=nslookup.exe sets=server 10.129.210.71

Entering sets in NSLOOKUP would now set the server to 10.129.210.71. To viewcurrent macros for an image use

doskey /exename= /macros, for example

C:>  doskey /exename=nslookup.exe /macros
sets=server 10.129.210.71

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like