16

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.

Kirt
  • 7,561

3 Answers3

24

You can use the doskey command to do this:

doskey /HISTORY > history.txt
heavyd
  • 65,321
0

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.

-1

To export the history, I was able to simply right click the window, click "select all" then CTRL-C to copy. I then CTRL-P pasted into a text editor.

You'll want to max out the screen buffer height to 9999 when you start your session because you'll only be able to copy text that's showing in the buffer. You set the screen buffer height by right clicking the title bar of the cmd window, select properties, click the layout tab.