Skip to content

Instantly share code, notes, and snippets.

@mevanlc
Last active May 8, 2019
Embed
What would you like to do?
Add "Cmd Here" context-menu entry to Windows Explorer. Mnemonic hotkey is spacebar.
Windows Registry Editor Version 5.00
; After right-clicking on a folder in Windows Explorer,
; you can press spacebar to immediately execute Cmd Here and open a cmd prompt.
[HKEY_CLASSES_ROOT\Folder\shell\cmdhere]
@="Cmd& Here"
; By using pushd, we are able to open a cmd prompt on \\network\shares as an automatically mapped temporary drive letter.
; Make sure to use the "exit" command to close the command prompt, to automatically unmap the temporary drive.
[HKEY_CLASSES_ROOT\Folder\shell\cmdhere\command]
@="cmd /k \"cls&pushd \"%l\"\""
; This adds a menu entry when right-clicking in the background space of an open folder.
; Convenient because you don't have to move up to the parent directory to execute.
[HKEY_CLASSES_ROOT\Directory\Background\shell\cmdhere]
@="Cmd& Here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\cmdhere\command]
@="cmd /k \"cls&pushd \"%V\"\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment