Is there a way to keep the cmd command history between sessions?

link|improve this question

76% accept rate
feedback

1 Answer

up vote 5 down vote accepted

Switch to using PowerShell, and follow the instructions at the following site to enable history:

http://blogs.msdn.com/b/powershell/archive/2006/07/01/perserving-command-history-across-sessions.aspx

Alternatively, in cmd.exe, you can use "doskey /history" at the end of your session to show what you typed in that session, but theres no way to really load it into the next session.

link|improve this answer
1  
I hestitated to +1 this because "Switch to using PowerShell" is not necessarily as easy as it sounds depending on what sort of stuff you're using the console for, but the info is accurate soooooooooo ;) – Shinrai Mar 15 '11 at 14:23
Agreed. I hesitated to put it down but it's the only real answer I can find. I tried to get something similar going on a workstation I had before, but there just isn't a persistent history mechanism available for cmd.exe :-( – Hyppy Mar 15 '11 at 14:27
Note that this will keep a list of commands you typed, but it doe NOT alter the list of commands that will come up when you hit the up key on the keyboard. It doesn't affect the "doskey" functionality, in other words. – Mark Apr 13 '11 at 19:06
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.