0

Scenario

I'm using Windows 10, but I have the same problem In other Windows versions.

I've added a custom item in my Windows contextmenu, it is intended to be accesible by right-clicking from a directory folder, or from a directory background.

This registry script reproduces my custom contextmenu item (except the subcommands):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\PATHS]
"MUIVerb"="PATHS"
"SubCommands"="PATHS.AddDirBackground;PATHS.RemoveDirBackground"
"Icon"="C:\\Program Files\\PATHS\\PATHS.Title.ico"
"Position"="bottom"

[HKEY_CLASSES_ROOT\Directory\Background\shell\PATHS]
"MUIVerb"="PATHS"
"SubCommands"="PATHS.AddDirBackground;PATHS.RemoveDirBackground"
"Icon"="C:\\Program Files\\PATHS\\PATHS.Title.ico"
"Position"="bottom"

enter image description here


Problem

The problem I have is that Windows seems to treat the desktop background in the same way as a directory background, so my custom contextmenu item is visible when I do right-click on the desktop background:

I don't like this behavior, because this contextmenu item isn't useful when accesible from the desktop background, it only increases the size of the desktop contextmenu in general.


Question

How I could disable my contextmenu item from still appearing on the contextmenu of the desktop background?.

Please note that its a simple contextmenu item manually added via registry, I don't pretend to rework the implementation via shell extension.


Research

In this article I seen a natural methodology or hack to hide or disable any contextmenu item:

enter image description here

However, I'm not sure how to do it neither if that is really what I need.

I tried to add a "ghost" item on the DesktopBackground registry key trying to override the original item that I have on Directory\Background key, but the item still shown when I do right-click on the desktop background:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\DesktopBackground\shell\PATHS]
"MUIVerb"="PATHS"
"LegacyDisable"=""

Or:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\DesktopBackground\shell\PATHS]
"MUIVerb"="PATHS"
"Extended"=""

On the other hand, the trick works ok for the original items that are stored in the registry keys mentioned above, but this trick doesn't works for this "ghost" or "dummy" item which is the one that I want to hide from contextmenu.

  • 3
    What made you think the desktop was different from a folder? Your Desktop itself is an interface to the contents of a specific folder. What you want to have happen goes against the base core concept of Windows as an operating system – Ramhound Oct 13 '15 at 15:13
  • What made you think the desktop was different from a folder? Here is the big difference: HKCL\DesktopBackground\Shell vs. HKCL\Directory\Background\Shell there is one key for desktop shell menu, and one different key for directory shell menu. You said it yourself, it is an iterface, and that means it is not treated in the same way as any other folder because it is a different "representation" with a GUI that covers the screen. Anyways, I think we are not here to discuss what is a desktop environment. At least not in that way... thanks for comment. – ElektroStudios Oct 13 '15 at 15:20
  • It will be ok If I manually navigate through Explorer to the desktop folder then I do a right-click on its folder background, which is not the same thing as doing a right-click on the desktop background. – ElektroStudios Oct 13 '15 at 15:24
  • 1
    It's still a folder. Which is obvious if you open explorer and look for it. It contains other folders and shortcuts. – DavidPostill Oct 13 '15 at 15:25
  • @DavidPostill Yes its an (user)folder,of course,that was clear from the start.The thing I mean is that HKCL\DesktopBackground\Shell items only affects to the desktop background, while HKCL\Directory\Background\Shell affects to folders background (including the desktop folder), then, there exists a difference between items on one place or the other place, and In my question I'm trying to ask if exist a way to avoid an item placed in HKCL\Directory\Background\Shell still affects in the desktop background, by disabling it in some way in the desktop background contextmenu.Thanks for comment – ElektroStudios Oct 13 '15 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.