Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to start cmd (using Autohotkey or even more preferably Hotkeyz) in the directory in which Explorer is currently (i.e. in the directory which is currently open in Windows Explorer)?

While waiting in here, I also stumbled onto a script which supposedly should do that, but it doesn't work. Can anyone see the possible problem which may stop her from doing the above mentioned.

Full script below, c/pasted from here

; Opens a command prompt with the current folder 
; when you press Ctrl+Alt+H in Explorer
; or the command prompt

^!h::
if WinActive("ahk_class CabinetWClass") 
or WinActive("ahk_class ExploreWClass")
{
 ClipSaved := ClipboardAll
 Send !d
 Sleep 10
 Send ^c
 Run, cmd /K "cd /D `"%clipboard%`""
 Clipboard := ClipSaved
 ClipSaved =
 return
}
else if WinActive("ahk_class ConsoleWindowClass") 
{
 Send ^c 
 Sleep 10
 Send explorer .{Enter}
 Sleep 10
 return
}
exit
share|improve this question
    
Retag done... =) –  BloodPhilia Aug 30 '10 at 23:27
    
@BloodPhilia - Thanks. –  Rook Aug 30 '10 at 23:40
    
You're welcome =) –  BloodPhilia Aug 30 '10 at 23:44

2 Answers 2

Whenever I install Windows XP, one of the first pieces of software I install is the Open command window here Powertoy from Microsoft. It's available free from the Powertoys page. Right-click on a folder in Explorer and you get a new option to open a command window in that folder.

share|improve this answer
    
Yes, I know of that one. I'm actualy using one even better (imho), that I found somewhere on the net, that opens the cmd in the currently open directory, but I would still prefer a keyboard option with a shortcut. Also, it will be a part of some bigger script (if I manage to complete it <- hopefully). –  Rook Aug 30 '10 at 23:32
    
@Rook would you mind sharing this "better one"? It might benefit others also. –  BloodPhilia Aug 30 '10 at 23:42
    
@BloodPhilia - Of course I wouldn't, perish the thought. Aa a matter of fact, I was just now looking for the download link. And I shouldn't have used the word better, but maybe different. It does practically the same thing with a different (to me more natural) approach. code.kliu.org/cmdopen –  Rook Aug 30 '10 at 23:47
    
@Rook Thanks for sharing! ;) –  BloodPhilia Aug 30 '10 at 23:59

I like Command Prompt Explorer Bar. It extends Explorer with the functionality of a command prompt. Opens in the folder you are currently pointing to, using Ctrl+M.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.