Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I was working with RedHat at Uni, one of the things I liked most about the command line was that it stored commands from previous sessions to its buffer for long-term retrieval. The ability to press up a couple of times and rerun a command set from yesterday was a big help in getting me to accept the notion of typing being better than clicking.

Of course, now I'm back to WinXP and its successors, it's a perpetual pain in the neck to retype the same command sets every time I open a new command prompt dialogue, especially the pathnames. Clearly I've been spoiled. but...

Is there any way to make the Windows Command Prompt store its buffer from one session to the next?

Edit: My office has pretty strict policies on downloading to work PCs, so while I'm interested in alternative programs for home use, I'd prefer a solution that isn't dependent something like cygwin or Powershell.

share|improve this question
    
I suggest you install cygwin instead that way you get a proper shell (bash or ksh) –  Nifle Jul 30 '09 at 10:39
    
Hmmm, without downloading, your options are zero I guess. (Somewhere in the 90's I enhanced MS-Dos' doskey.exe to store the commands on disk. Funny that it still doesn't remember commands across sessions.) –  Arjan Aug 1 '09 at 13:04

3 Answers 3

up vote 3 down vote accepted

Cygwin is the best option here. It keeps command history just like your unix shell does on a genuine unix box. Something to be said about cygwin is that it supports all of the native shell commands that windows "knows and loves".

So do not think just because you are running it in a cygwin shell that you have any limited functionality. Cygwin appears to be running right on top of a command shell within windows.

share|improve this answer
    
My actual concern here wouldn't be reduced functionality, but expanded functionality that wouldn't port, leaving me with odd "Works on My Machine" bugs. I assume that's not an issue? –  deworde Jul 30 '09 at 22:57
    
Some batch files won't run within the Cygwin shell, and Unicode support may have issues. But both are not real issues as one can always use cmd.exe even when Cygwin is available. (I had problems with the Ruby on Rails gem and rake commands, which for what I've read may have been caused by DOS CrLf line ends. And maybe Cygwin using /cygdrive/c/xx rather than C:\xx may yield problems for smart batch files, or maybe start won't work. The Unicode issue had something to do with codepage 65001 and non-rasterfonts, which would make Unicode work in cmd.exe but not in the Cygwin shell.) –  Arjan Aug 1 '09 at 13:58

You could always trying using Powershell. All of the usual DOS commands are still supported, and if you use a script like this one you can make it preserve the command line history between sessions.

share|improve this answer

I'd suggest you to use Far manager on a daily basic (http://www.farmanager.com). So, in Far CTRL-E works as a switcher of previous commands, even from yesterday and the day before yesterday.

As for the software, Far Manager is a long time successor of Norton Commander (or I'd say it was inspired by) created by the author of Rar compression utility. The stable version is a shareware, but even as a non-registered shareware quite useful. Also recently an open-source unicode version supported by a group of developers started. Far has a plugin system (for example WinSCP plugin from the author of WinSCP and tons of other plugins). It's a good replacement of cmd for any command-line operations (if you know or knew NC, you know what I mean) and from the other side the replacement of explorer if you prefer keyboard to mouse. I can't remember when I last time copied something with explorer or anything else :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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