Use this keyboard shortcut: Shift + Menu, W, Enter
Shift + Menu (alternatively, Shift + F10), (opens extended right-click menu in current folder)
W (selects "Open Command Window Here"),
- Enter (activates selection; required since "New" is also selectable with W)
The Menu key refers to the special key introduced by Microsoft, usually to the right of the right Win key.
This shortcut is available on a default installation of Windows (7) without any 3rd party software.
The AHK way. You just need to press Win + C (or whatever you want to define it as.):
SetTitleMatchMode RegEx
return
; Stuff to do when Windows Explorer is open
;
#IfWinActive ahk_class ExploreWClass|CabinetWClass
; create new text file
;
#t::Send !fwt
; open 'cmd' in the current directory
;
#c::
OpenCmdInCurrent()
return
#IfWinActive
; Opens the command shell 'cmd' in the directory browsed in Explorer.
; Note: expecting to be run when the active window is Explorer.
;
OpenCmdInCurrent()
{
; This is required to get the full path of the file from the address bar
WinGetText, full_path, A
; Split on newline (`n)
StringSplit, word_array, full_path, `n
; Find and take the element from the array that contains address
Loop, %word_array0%
{
IfInString, word_array%A_Index%, Address
{
full_path := word_array%A_Index%
break
}
}
; strip to bare address
full_path := RegExReplace(full_path, "^Address: ", "")
; Just in case - remove all carriage returns (`r)
StringReplace, full_path, full_path, `r, , all
IfInString full_path, \
{
Run, cmd /K cd /D "%full_path%"
}
else
{
Run, cmd /K cd /D "C:\ "
}
}
As a bonus, the script above also creates a new text file with this shortcut: Win + T
Credit to: Eli Bendersky
You were pretty close to solution. For me the following command works:
cmd.exe /s /k "pushd ""%V"" & title %V"
EDIT: There are several places in registry supporting the "Command Prompt Here" shell extension. For this change to work consistently across all objects (directories, drives and special folders), you have to search the registry for all occurrences of cmd.exe /s /k pushd "%V"
and replace them with the value above.
Best Answer
There is no built-in way to do this. But you can create one for the right-click of a folder (just like the "Open command prompt here" examples on the internet).
Create a file named
Open Node-prompt here.reg
and double click it (and click Yes and OK):This will start the normal (
cmd.exe
) prompt in the correct chosen directory with first setting all the necessary variables fornode.exe
. After doing thedir
s andcd
s you can call yournode program.js
just like normal.