Terms of Use For FixedByVonnie

By proceeding to access fixedByVonnie.com, you expressly acknowledge, and agree to, all of the following:

fixedByVonnie.com is a personal website and blog owned by Security Plus Pro LLC, which is being presented for informational purposes only. The views on this website are solely those of the website owner (and not those of any employer or of any professional associations affiliated with the website owner).  Any views expressed in this website and any information presented on this website, or in any of its blog entries, should not be relied on for any purpose whatsoever other than as the personal opinions of the website owner.  The website owner expressly disclaims any and all liability for any information presented on this site.  The owner of this website and its blog posts shall not be held liable, and shall be held harmless, for any errors or omissions in any information or representations contained in this website, or in any of its blog entries.  The website owner also expressly disclaims any liability for the current or future availability of any such information. The website owner makes no representations as to the accuracy or completeness of any information on this website or which may be found by following any link on this website. The website owner shall not be held liable for any losses, injuries, damages, claims, or causes of action, from the display or use of any information on this website or in any of its blog entries. If you use the information on this website, or on any of its blog entries, you do so solely at your own risk.

5 Command Prompt Hacks You Probably Don't Know - fixedByVonnie

5 Command Prompt Hacks You Probably Don’t Know

I love the Windows Command prompt because I often get things done faster by typing a command rather than hunting down an icon or nested menu setting.

I’ve discovered that as I’ve used the command prompt, I’ve adopted my own shortcuts, I’ll call them hacks, that have really boosted my productivity.

Here are my top five:

1. Copy Path on Folder Drop

I had a file buried in C:\xampp\htdocs\Vonster\wp-content\themes\twentytwelve that I needed but look at that folder path: if I manually type it I’ll instantly make myself susceptible to all kinds of typos plus I’m lazy and couldn’t care less about typing folder paths.

To paste the full path, just drag the folder and drop it into the command prompt.

In my case I typed cd in the command prompt and then dragged my folder into the command window.

Command Prompt Drop Paste

2. View history with F7

One way to recount the list of commands you typed during a session is to press the up and down arrow keys.  Up goes back in time and Down moves forward to the present.  You probably already knew that; however, there’s an alternate way that can save you a few keystrokes.

Pressing F7 lets you see your 10 most recent commands in a single glance.  Now you can arrow up or down and press enter on the exact command you need to recall.

Command Prompt History with F7

3. Pretty Print the Current Directory

Whenever you want to view the directory contents you type dir but sometimes you just want to view the structure without the datestamps and file sizes.  Welcome to the tree /a command.

tree let’s you view all the folders and subfolders of the current directory as a rudimentary ASCII art print out.

Since the output is usually long, I always add the redirection operator to send the results to a file.

Command Prompt tree /a command

And here’s the text file I saved the output to.

I entered this command from C:\xampp\htdocs\Vonster.  If I entered it from C:\xampp\htdocs\ I would get every folder and subfolder in the htdocs parent

tree /a > c:\vonsterWebsite.txt

Command Prompt tree /a command output

4. Send Command Output to the Clipboard

A related command is the clip option.  After any command insert a space then type the vertical pipe (it’s right below the backspace and shares a key with the backslash).  After the pipe insert another space and type clip.

For example to send the ipconfig results to your clipboard rather than the command prompt window – type this:

ipconfig /all | clip

Send Output to the Clipboard

5. Get Help

The quick way to get help on a command is to tack on a baskslash and question mark.

For example, let’s say I want to use netsh but I forgot how to view all the Wireless Profiles on my computer.

I enter:

netsh /?

Command Prompt Help

Now I can see a list of every netsh command…

Near the bottom of the list I see a command called wlan.  Hmm maybe that’s it.   Let’s give it a shot.

netsh wlan /?

Command Prompt Help 2

Now I’ve narrowed down the list…

Perhaps the show command will do the trick.

netsh wlan show /?

Command Prompt Help 3

And there it is near the bottom of the list: show profiles.

netsh wlan show profiles

The Bottom Line

The command line is the place where power users dwell.  It’s easy to change directories, view network information and execute basic network functions.  Most of the time, the basic commands suffice; however, there’s a few things you can do to get more out of the command prompt.  Dragging folders into the command prompt saves you the effort of typing a long folder path.  Pressing F7 brings up your more recent commands at a glance.  The tree command gives you a nice visual of your directory structure.  The clip filter redirects the output to the clipboard and the help switch can quickly get you out of a bind when you’re not sure where to go.


Connect with Vonnie on Twitter

Posted in How To, Windows 7, Windows 8, Windows 8.1, Windows Vista, Windows XP Tagged with: