1

I want to add a custom context menu item to Windows Explorer in Windows 10, so that when I right-click on certain types of file, I can run a particular application on the file. I have found various guides on the web with similar solutions to the StackOverflow question Add menu item to Windows Context Menu only for specific filetype.

From what I understand, if I want the context menu to appear for .JPG files, I check the registry and find that Win10 gives these the jpegfile type. I need to use regedit to add the registry key HKEY_LOCAL_MACHINE\Software\Classes\jpegfile\shell\myapp\command, and set its default value to the path to my app.

Unfortunately, this doesn't seem to work: I don't see any new context menu item. Also, I noticed in the registry that another menu item had previously been added for jpegfile (Open in GIMP). It doesn't work either, so I presume it's not just me failing to follow the instructions properly. I've checked that the paths are correct for both my app and the GIMP executable. I have also tried both a standard right-click and a shift-right-click to display the context menu.

  • Is there some trick to getting this style of context menu to display?
  • Has something changed in Windows 10, so that this type of hack no longer works? If so, is there an alternative method?
  • Could something else be inhibiting display of these menu items? Where should I start looking?
4
  • How did you get on with the other answer on this page (another variant of it here: stackoverflow.com/questions/39551212/…) where it suggests using SystemFileAssociations rather than Software\Classes? Was the GIMP association created by the GIMP installer? If it was then re-running the installer might fix that association. Commented Jun 10, 2020 at 14:26
  • Is .jpeg AND .jpg associated with jpegfile. Context menus registry entries are valid on the extension as well. And use HKEY_CURRENT_USER as settings there will override local machine. HKEY_CLASSES_ROOT is a merged view of User and System.
    – Mark
    Commented Jun 10, 2020 at 22:31
  • @Mark Yes, both .jpeg and .jpg were associated with jpegfile. I tried setting the key on the extension directly too, and that didn't work either.
    – JRI
    Commented Jun 10, 2020 at 23:04
  • @trapper_hag Thanks, I'd missed that. Using `HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\image\Shell` worked a treat for all image types. If you add it as an answer, I'll accept it. Incidentally, I updated to the current GIMP, which replaced the broken menu item entry, and added GIMP to the 'Open with...' menu via a different registry mechanism.
    – JRI
    Commented Jun 10, 2020 at 23:10

1 Answer 1

1

(Glad to hear you got it sorted)

Try editing HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\.jpg\Shell rather than HKEY_LOCAL_MACHINE\Software\Classes\jpegfile\shell. See here for details: https://stackoverflow.com/a/42776281/957246

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .