Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I export the history from the Windows command line to a text file?

I think you can do it in Linux as something like "history >filename.txt", but how do you do it in Windows? I'm a geneticist, and I want a record of exactly what programs I've run for my lab book.

I'm using Windows 7 64 bit if it makes a difference.

share|improve this question
up vote 9 down vote accepted

You can use the doskey command to do this:

doskey /HISTORY > history.txt
share|improve this answer
doskey is not a command, it is external utility. – Andrejs Cainikovs Sep 29 '10 at 12:29
@Andrejs, actually its built into cmd.exe. See the Wikipedia article: In current Windows NT-based operating systems DOSKey's functionality is built into cmd.exe, although the DOSKey command is still used to change its operation. – heavyd Sep 29 '10 at 12:32
seems i need to include the doskey bit? – Kirstin Sep 29 '10 at 12:37
also, is there a way i can get it to include information printed to the screen as well? – Kirstin Sep 29 '10 at 12:37
To see it on the screen, use just doskey /history – heavyd Sep 29 '10 at 12:43

Use PowerShell. It has the get-history command.

share|improve this answer
Consider leaving a comment if you are down-voting the answers. I don't find my answer as wrong.. It is just one option out of many, the same as most answers on StackExchange sites. – Andrejs Cainikovs Oct 4 '10 at 9:26

clink provides features that are similar to GNU readline and bash. In addition to history, you get something that's very similar to the navigational power that you get in Unix.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .