Where in the registry are the context menu options for 7zip?

I'd like to edit the context menu options for 7zip in the Windows File Explorer.

More precisely, I'd like to replace Add to archive... by &Add to archive to be able to use a keyboard shortcut like APPS KEY +A to open this.

In which regedit keys/values should this be done? In:

HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\7-Zip

I see:

{23170F69-40C1-278A-1000-000100020000}

Then in HKEY_CLASSES_ROOT\CLSID\{23170F69-40C1-278A-1000-000100020000}, I only see a link to the 7zip DLL file.

I know the usual method to set context menu options with:

HKEY_CLASSES_ROOT\*\shell\Action x\command

where I can set the command and also modify the text in the menu. But here with 7zip how to modify this menu item text? Adding & before Add to archive... will underline the letter A, and will enable A as a keyboard shortcut.

More info in Keyboard shortcut for 7z "Add to archive...".


Solution 1:

I know the usual method to set context menu options with:

No, that's one of the usual methods.

Then in HKEY_CLASSES_ROOT\CLSID{23170F69-40C1-278A-1000-000100020000}, I only see a link to the 7zip DLL file.

All 7-Zip context menu options are defined in this DLL file – they are not static; they depend on what kind of file you right-clicked, so a DLL function is invoked every time Windows needs to show the menu and decides whether to insert each of the available options.

To actually change what a DLL file does, normally you'd have to find its source code, then edit and recompile it. However, as the menu labels are stored as string resources in the DLL (and not embedded in code), you might have luck with Resource Hacker or similar tools that directly edit EXE/DLL embedded resources.

You can find the 7-Zip source code at SourceForge, though here's a more easily browsable copy on GitHub – among other things, the DLL has functions that implement the IContextMenu COM interface expected by Explorer.