views:

1919

answers:

6

I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory.

I am aware of Power Toys "Command Prompt", but that only works as a context menu item on the folder, and not from inside the folder if you are already there. I know you can navigate to the parent directory, and use it from there, but if the parent has thousands of directories in it, this is not so convenient. I have tried some home-brewed batch files associated with folder actions in explorer, but those suffer from similar problems.

So, what is the quickest way to open a command prompt with a working directory of the current windows explorer folder?

My current approach: (horrible)

  • Alt - D, Ctrl - C (copy path)
  • Win - R, "cmd", Enter (start command prompt)
  • "cd", Space (start a change directory command)
  • Alt - Space, e, p (paste directory)
  • Enter (execute change directory)

I know there is something better! What is it?

+3  A: 

I use StExBar, a Windows Explorer extension that gives you a command prompt button in explorer along with some other cool features (copy path, copy file name & more).

http://tools.tortoisesvn.net/StExBar

EDIT: I just found out (been using it for more than a year and did not know this) that Ctrl+M will do it with StExBar. How's that for fast!

palehorse
+1  A: 

If that's so bothering, you could try to switch to windows explorer alternative like freecommander which has a toolbar button for that purpose.

Gennady Shumakher
+1  A: 

Almost the same as yours:

  • Alt+d, Ctrl+c
  • Win+r
  • cmd /K cd , Ctrl+v, ENTER
Sam Meldrum
Excellent!The last line seems like it should be "cmd /K cd /D", Ctrl+v, ENTERFor posterity.
recursive
You may need "s if there are spaces in the path.
EBGreen
+10  A: 

Right-click the title-bar icon of the Explorer window. You'll get the current folder's context menu, where you'll find the "command window here" item.

(Note that to see that menu item, you need to have the corresponding "power toy" installed, or you can create the right registry keys yourself to add that item to folders' context menus.)

Rob Kennedy
I don't see it in XP either.
palehorse
Works in Win2k. Awesome.
recursive
Cool. Is there a way to do that with the keyboard?
Hugh Allen
Hugh, please see fm's answer: type "cmd" into the address bar. Based on the question's text, I gather you can get to the address bar with the keyboard with Alt+D.
Rob Kennedy
+10  A: 

In Vista, hold Shift while Right-Clicking a blank space in the desired folder to bring up a more verbose context menu. One of the options is Open Command Window Here

TenebrousX
Sweet! +1 Thanks for the tip.
RobH
+8  A: 

In Windows Vista just type "cmd" to location bar, that's it. It will start a new command prompt in current path.

Better isn't it?

dr. evil
And you can quickly get to the location bar by pressing Alt+D.
Tim Stewart
Works in Windows XP. Great tip!
AMissico