Skip to content

Instantly share code, notes, and snippets.

@seamonkey420
Last active January 26, 2025 03:28
Show Gist options
  • Save seamonkey420/f07527630c79616221938ff0fd2a4311 to your computer and use it in GitHub Desktop.
Save seamonkey420/f07527630c79616221938ff0fd2a4311 to your computer and use it in GitHub Desktop.
Example registry file for creating Windows context menu item with submenu and seperators (see comment for notes/explanations)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Media Tools]
"MUIVerb"="Media Tools"
"icon"="\"C:\\Users\\USERNAME\\Scripts\\ffmpeg-32.ico\""
"SubCommands"="InstDbg1;InstDbg2;InstDbg3;InstDbg4;InstDbg5;InstDbg6;InstDbg7"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg1]
@=""
"icon"="\"C:\\Users\\USERNAME\\Scripts\\mkvtoolnix.ico\""
"MUIVerb"="Open with MKVToolNix"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg1\command]
@="cmd.exe /c \"\"C:\\Users\\USERNAME\\Scripts\\ffmpeg related\\Open MKVToolnix.cmd" \"%1\"\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg2]
@=""
"icon"="\"C:\\Users\\USERNAME\\Scripts\\ffmpeg-32.ico\""
"MUIVerb"="Extract | Add AC3 Audio"
"CommandFlags"=dword:00000020
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg2\command]
@="cmd.exe /c \"\"C:\\Users\\USERNAME\\Scripts\\ffmpeg related\\Extract and Add AC3 Audio.cmd\" \"%1\"\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg3]
@=""
"icon"="\"C:\\Users\\USERNAME\\Scripts\\ffmpeg-32.ico\""
"MUIVerb"="Extract | Add AAC Audio"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg3\command]
@="cmd.exe /c \"\"C:\\Users\\USERNAME\\Scripts\\ffmpeg related\\Extract and Add AAC Audio Track.cmd\" \"%1\"\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg4]
@=""
"icon"="\"C:\\Users\\USERNAME\\Scripts\\ffmpeg-32.ico\""
"MUIVerb"="Convert H264 to H265"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg4\command]
@="cmd.exe /k \"\"C:\\Users\\USERNAME\\Scripts\\ffmpeg related\\Convert H264 to H265.cmd\" \"%1\"\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg5]
@=""
"icon"="\"C:\\Users\\USERNAME\\Scripts\\ffmpeg-32.ico\""
"MUIVerb"="Convert WebM to MKV"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg5\command]
@="cmd.exe /k \"\"C:\\Users\\USERNAME\\Scripts\\ffmpeg related\\Convert webm to mkv.cmd\" \"%1\"\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg6]
@=""
"icon"="\"C:\\Users\\USERNAME\\Scripts\\ffmpeg-32.ico\""
"MUIVerb"="Convert to MP4"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg6\command]
@="cmd.exe /k \"\"C:\\Users\\USERNAME\\Scripts\\ffmpeg related\\Convert to MP4.cmd\" \"%1\"\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg7]
@=""
"icon"="\"C:\\Users\\USERNAME\\Scripts\\mkvtoolnix.ico\""
"MUIVerb"="Fix Colorspace (H265)"
"CommandFlags"=dword:00000020
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\InstDbg7\command]
@="cmd.exe /c \"\"C:\\Users\\USERNAME\\Scripts\\RemoveColorSpace.cmd\" \"%1\"\""
@seamonkey420
Copy link
Author

seamonkey420 commented Jan 25, 2025

Main points:
Works with Windows 10, 11.

[HKEY_CLASSES_ROOT\*\shell\Media Tools]
"MUIVerb"="Media Tools"
"icon"="\"C:\\Users\\USERNAME\\Scripts\\ffmpeg-32.ico\""
"SubCommands"="InstDbg1;InstDbg2;InstDbg3;InstDbg4;InstDbg5;InstDbg6;InstDbg7"
  • change Media Tools to what you want main context menu to show.
  • Update MUIVerb to be same name
  • If you want an icon to show, update icon path with location to ico file, remember to use \ in path (see example)
  • Subcommands are the names for the sub menu items, if you have 8 you would need to add another InstDbg8.

Then the entries below this top line are the actual commands for the sub menus.

  • this line: "CommandFlags"=dword:00000020 will insert a seperator before this entry.
  • update @ to be the command you want item to run
  • MUIVerb = name that will show in sub menu
  • icon = location to icon if you want one

Example of what this will look like. This example will only show the context menu item when you right-click on a file.

context submenu example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment