Windows shell add item to context menu when click on blank part of folder

25,331

Solution 1

I figured out the answer. The folder is actually Directory\Background, you have to add the empty string value of NoWorkingDirectory into it, and the %1 in the command becomes a %V

[HKEY_CLASSES_ROOT\Directory\Background\shell\console2]
@="Open Console2 Here"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\console2\command]
@="C:\\Program Files\\Console\\console.exe -d \"\"%V\"\""

Source: saviert's comment at http://www.howtogeek.com/howto/windows-vista/make-command-prompt-here-always-display-for-folders-in-windows-vista#comment-57856

Solution 2

Console2 rocks. I added an 'Cmd here (Console2)' item to my explorer context menu.

enter image description here

Save the text below in a file named open-console2.reg then open it to import it to the Windows registry.

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\console2]
@="Cmd here (Console2)"
"NoWorkingDirectory"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\console2\command]
@="\"C:\\Program Files (x86)\\Console2\\Console.exe\" -d \"%V\"\\"

Bonus 'bash here' item (assumes you have a Console2 tab named 'bash').

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\console2_bash]
@="Bash here (Console2)"
"NoWorkingDirectory"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\console2_bash\command]
@="\"C:\\Program Files (x86)\\Console2\\Console.exe\" -t Bash -d \"%V\"\\"

Solution 3

I think the relevant part of the TortoiseSVN installer is here. Perhaps you can figure out all the necessary registry keys from that.

Solution 4

None of the above worked for me.

But this does (tested on Windows 7 Pro x64):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\Open console here\command]
@="u:\\users\\dave\\data\\bin\\Console2\\Console.exe cmd -r \"/k pushd %L\""

Replace the path with the path to your copy of console.exe (of course).

Share:
25,331
user380527
Author by

user380527

Updated on January 11, 2020

Comments

  • user380527
    user380527 over 4 years

    Sorry if this has been asked before, I've been looking around and it's hard to find what I want.

    I know how to add a context menu item to a folder like so:

    [HKEY_CLASSES_ROOT\Folder\shell\console2]
    @="Open Console2 Here"
    
    [HKEY_CLASSES_ROOT\Folder\shell\console2\command]
    @="C:\\Program Files\\Console\\console.exe -d \"\"%1\"\""
    

    but, that only works for right clicking on a folder. I want it so that you can be inside the folder, and click a blank part of that folder and get the context menu item as well. I also tried HKEY_CLASSES_ROOT\Directory\shell as well, but it does the same.