How can I add a custom context menu to all extensions of a particular type (e.g. all video files)

Viewed 379

Background/Problem

I have added custom context menus to a number of filetypes individually...

HKEY_CLASSES_ROOT
  VIDEO_FILETYPE_1 (.MP4)
    SHELL
      CUSTOM_MENU
        COMMAND
  VIDEO_FILETYPE_2 (.MKV)
    SHELL
      CUSTOM_MENU
        COMMAND

However, this only applies specifically to the filetypes configured...
✅ .MP4 files
✅ .M4V files
❌ .MOV files

I could keep customising more and more filetypes in the registry, however this is already starting to get a bit tedious (have tweaked 30+ types so far) and time-consuming to update (for example: changing an icon means running 30+ .reg scripts).

Conversely, I don't really want to extend the * filetype as there is no point asking if I want to .reg file with Avidemux for example.


Solution needed

Is there a way I can add (attach) a custom context menu to ALL filetypes of a particular type (e.g. video)...

For example...

HKEY_CLASSES_ROOT
  VIDEO
    SHELL
      CUSTOM_MENU
        COMMAND

This then adds the menu to all filetypes where PerceivedType=Video...
✅ .MP4 files
✅ .M4V files
✅ .MOV files

Thanks in advance!

1 Answers

You can register supplemental verbs based on the perceived type under HKEY_CLASSES_ROOT\SystemFileAssociations\video\shell. This works on Windows XP and later and is documented here.

Regedit and shell menu

Related