Saving Your Command Line History

Many times I find myself in a command window hacking away deploying solution packages or activating features to only later think to myself that I would love to save those commands to a batch file. Previously I would have copy and pasted the contents of the window into notepad and started removing all of the directory information but now I use this method below:

doskey /history > commands.bat

This will export the entire command window history into a file called commands.bat. You’ll just need to go into commands.bat and remove any of the unwanted commands. Enjoy!

I'm a public speaker and the Chief SharePoint Architect for Eastridge Technology, a Microsoft Gold Competency Partner in Winston-Salem, NC. I focus on the SharePoint platform with a specialty in Information Architecture, Internet Facing and Mobile applications.

Got something to say? Go for it!