Persistent command history between different cmd sessions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear All,

I would like to know if there is a known MS supported fix I can use/apply
to my windows XP pc, which would allow me to remember old DOS commands I have
done in older DOS sessions. The DOSKEY function and the F7 shortcut is very
useful, and it would be brilliant if this functionality would be extended so
that a new command.exe would also remember older sessions...

I have searched on the web .. and have until now only found 3rd party
products (which cost money)..

Where would be the best forum to ask this question ?

Kind regards
Ben Bookey
 
Hi Ben,

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 10.129.210.71

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

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

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

More information here:
http://www.windowsitpro.com/Articles/ArticleID/15338/15338.html?Ad=1

--

All the Best,
Kelly (MS-MVP/DTS&XP)

SUPERAntiSpyware
http://www.superantispyware.com?rid=3154
 
Hallo Kelly,

Thanks for your reply. I know the doskey command as I said.

Are you saying that this tool can be configured to remember commands between
different command.exe sessions ? or not ?

i.e. I can reboot the machine and I can restart the command shell and I see
the hístory ?????????????????

regards
BEN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top