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

前端 未结 7 718
北海茫月
北海茫月 2020-12-24 02:22

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:

相关标签:
7条回答
  • 2020-12-24 02:37

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

    0 讨论(0)
  • 2020-12-24 02:39

    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

    0 讨论(0)
  • 2020-12-24 02:45

    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\"\\"
    
    0 讨论(0)
  • 2020-12-24 02:45

    This can be achieved in XP as well. First open the program Run with the Windows key + R, and type Regedit in the textbox. Press Enter. In the Registry open the Key : HKEY_CLASSES_ROOT and then : * You will now see a key called : shell Rightclick on shell and point to New. Click in de menu on Key. Now type a name of your choice which you want to appear in the Rightclick menu. Rightclick on the name you chose, again point to New and click Key. Now type : command Click on command and in the right pane of the Registry doubleclick on (Default). In the textbox Value Data, type the path to an application you want to open via the chosen name in the rightclick menu. For example : "C:\Program Files\CCleaner\CCleaner.exe" Then type after the path : %1, and leave a space between the end of the path and %1 It should look like this :

    "C:\Program Files\CCleaner\CCleaner.exe" %1

    This way, it's possible to open any kind of application you want. There's only one drawback, you have to rightclick another file to see the chosen name with which you can open the application. When you rightclick a folder this will not work.

    0 讨论(0)
  • 2020-12-24 02:56

    @Ben Voigt mentioned TortoiseSVN, you can also see WinMerge shell extension source code, or at last: create your own extension from scratch; I wanted to do something like this for XP but I have lots of other stuff to do now.

    As a workaround, you can just open a folder in XP, and then select View->Explorer Bar->Folders, to have folder tree on left, and then you're able to right-click the folder (active folder gets hightlighted automatically).

    command prompt on right click

    0 讨论(0)
  • 2020-12-24 02:58

    According to my personal experience of Windows XP (SP3), you can open Console2 inside the current directory with a context menu entry using the following .reg file:

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


    If you look at the key value inside regedit.exe , you should see:

    C:\Program Files\Console\console.exe -d "%1"
    


    instead of:

    C:\Program Files\Console\console.exe -d ""%1"" 
    

    The latter would open Console2 in its default start directory.

    0 讨论(0)
提交回复
热议问题