Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 334
user380527 Avatar asked Feb 04 '11 19:02

user380527


People also ask

How do I add something to the Windows context menu?

Add Any Program to Context Menu. Open the registry and navigate to the following path: HKEY_CLASSES_ROOT\Directory\Background\shell then right-click on shell and select New > Key. Give the new key the name of the program you're adding to the context menu.

How do I add folders to the context menu?

To add a folder you access often to the context menu, select Folder in the Item type to add box. In the Program to add box, click Choose Folder. NOTE: You can also add files to the context menu. If you choose to add Any type of file, the Choose Folder button becomes the Search button.

How do I add a folder to the context menu in Windows 10?

Open the Windows registry by pressing the Windows key + R and typing “regedit” or by typing “regedit” at the Start menu. Navigate to and expand the HKEY_CLASSES_ROOT folder. Under this folder, the folders or keys that begin with a dot refer to file extensions. You can create a context menu item for any of these.

What is add to Explorer context menu?

In File Explorer in Windows 11, the right-click context menu has been streamlined to make it easier to get to popular commands. You'll find your available options in a reorganized layout. To open the context menu, right-click (or press and hold) on a file or folder in File Explorer.


1 Answers

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

like image 50
user380527 Avatar answered Sep 27 '22 18:09

user380527