Windows Explorer and CMD

Here’s the setup: you’re browsing around in Windows Explorer, finding that command line tool or whatever. You find the correct location. Now you need to open up a command line. So you start/run/cmd, change drives if needed, and either copy/paste the folder path from Windows Explorer into CMD or manually navigate using a series of CDs and/or tabs.

Annoying, right?

A Trick

Here’s a trick I just learned today. I’m SURE this has been around forever, and is about as new as sliced bread. That being said, it’s a wonderful little shortcut and it deserves to be shared with everyone. It may only save a few seconds of real-time, but it saves a great many units of frustration-time. Here it is:

1) Find your location in Windows Explorer. In this case I’m browsing to the location of a NANT build script:


2) Put your cursor in the location bar, like so:

3) Type “cmd” and hit enter:


Boom. Nice, huh? There are a million different ways to skin this same cat, including installing power toys, scripts, shortcuts, etc. It’s nice, though, to utilize built-in shortcuts because they can be counted on across various Windows installations, specifically on production servers where you don’t necessarily want to install 3rd party tools or scripts.

Incidentally, this also works for “powershell”. And in both PS and CMD, there’s a way to reverse it. Type “explorer .” and Windows Explorer opens to your current PS/CMD location. My frustration level literally just went down a notch.

Earth shattering? Nope. Helpful? Duh.



One thought on “Windows Explorer and CMD

  1. Nice. I knew that you could right-click on a folder in Windows Explorer and “Open command window here”, but I didn’t know this trick.

The power compels you ...

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: