.NET Tips and Tricks

Blog archive

Command History in the Command Windows (and Fast File Names)

Up until a few weeks ago, the only way I knew of to get back to an old command in the Command Prompt was to press the Up arrow and walk back through the commands. It turns out that if you press F7 in the Command Prompt, a window pops up showing all the commands you've executed, and you can cycle through them with the Up or Down arrows (you can't edit the commands, though).

Speaking of editing commands: The most common error I make when entering commands is misspelling file or folder names. It turns out that I don't have to type in a full file name in the Command Prompt. If I type my command, followed by the first letters of the file or folder name I want and just keep hitting the Tab key, I'll cycle through all the file and folder names in the directory. I can even use wildcard characters (e.g. c*.DLL to find all the DLLs with names beginning with the letter C) with this trick.

And did you know that if you click on the icon in the left-hand corner of the Command Prompt title bar and select the Edit choice, you can cut, copy and paste in the Command Prompt?

Posted by Peter Vogel on 07/08/2012 at 1:16 PM


comments powered by Disqus

Reader Comments:

Wed, Jul 11, 2012 Rick

Pointing out the Tab key to autofill directories/file names? Has the author been living in the dark ages? That's been around forever. The big question is did MS steal it from Linux or vice-versa (I'm not taking sides, just pointing it out).

Tue, Jul 10, 2012 Don Australia

Yes, I knew about right clicking to copy and paste, though you need to press enter to make it work, otherwise it ignores you. Ok on the other suggestion of using F7

Mon, Jul 9, 2012 Peter Vogel Canada

Nope: The first poster's right--a right-mouse button click on the Command window gives you the Edit menu. Didn't know that!

Mon, Jul 9, 2012

I believe in order for the right-click to work, you need to enable QuickEdit mode in the Command Line properties. But it's something I always do first thing on a new PC, as it's pretty invaluable.

Mon, Jul 9, 2012

Use the right-hand button of the mouse over the Command Window and it reveals the same menu as the "Edit choice".

Add Your Comments Now:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.