Archive

Posts Tagged ‘Prompt’

Windows Command line – CMD – fu : Notes

February 15, 2017 Leave a comment

So i haven’t used the Windows Command (DOS) Prompt for many things until I realized that Android / Android Studio / Android SDK and the emulator (with the HAXM driver) work pretty well on Windows.

Long story short, there seems to be a lot of powerful things in this “predecessor” to Powershell.

Viewing and Saving Command History:

One of the things i wanted to do was to view my command line history. This can be easily done by pressing F7 and lo and behold a smaller dialog within the cmd window will appear with the command history.

Now, the F7 trick doesn’t really allow you to save the history, nor to copy-paste it, so i needed another solution. The command below provides this solution.

doskey /history > history.txt 

Essentially, this copies (redirects) the cmd history of only the current session into a text file named history.txt or whatever you’d like to name your text file .

Sources:

[1]. http://www.computerhope.com/tips/tip189.htm

[2]. http://serverfault.com/questions/95404/is-there-a-global-persistent-cmd-history

[3]. http://www.howtogeek.com/119386/5-windows-command-prompt-tricks-you-probably-dont-know/