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.

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
add comment

3 Answers

up vote 5 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
1  
@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
show 5 more comments

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
add comment

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
add comment

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.