How to Edit the Context Menu with the Registry (Safely)
The Windows right-click menu is stored in the registry under a set of "shell" keys. To edit it, open the Registry Editor, navigate to the key for the kind of menu you want to change, and add, rename, or delete the subkeys that represent individual menu entries. Before touching anything, export the key you're editing as a backup — that backup is your undo button.
Prefer a GUI? If you'd rather not touch the registry directly, MenuTrim does exactly the same edits through a safe interface with automatic backups.
The context menu registry keys
| What you right-click | Registry key |
|---|---|
| Files | HKEY_CLASSES_ROOT\*\shell |
| Folders | HKEY_CLASSES_ROOT\Directory\shell |
| Desktop / empty space | HKEY_CLASSES_ROOT\Directory\background\shell |
| Drives | HKEY_CLASSES_ROOT\Drive\shell |
Step 1: Back up before you edit
- Press Windows + R, type
regedit, and press Enter. Click Yes if prompted. - Navigate to the key you plan to edit.
- Right-click that key in the left pane and choose Export.
- Save it somewhere you'll remember (for example
Desktop\menu-backup.reg).
To undo any change later, double-click the .reg file and confirm — it restores the
exact state you exported.
Step 2: Read an existing entry
Each entry in the menu is a subkey under shell. Its display name is the
(Default) value of that subkey, and the command it runs is the (Default)
value of the command subkey inside it. For example:
HKEY_CLASSES_ROOT\*\shell\OpenWithNotepad
(Default) = "Open with Notepad" ← the label you see
Icon = "notepad.exe,0" ← optional icon
\command
(Default) = "notepad.exe" "%1" ← the command that runs Step 3: Add, rename, remove, or disable entries
- Add: right-click
shell→ New → Key, name it, set its(Default)to the menu label, then create acommandsubkey whose(Default)is the program path with"%1". - Rename: change the
(Default)value of the entry's key. (The key name itself doesn't affect the menu label.) - Remove: right-click the entry's key and choose Delete.
- Disable without deleting: add a
String ValuenamedLegacyDisableto the entry's key. The item disappears from the menu but can be restored by deleting that value.
Step 4: Apply your changes
Most edits appear immediately, but some need Explorer to refresh. The quick way: open Task Manager (Ctrl + Shift + Esc), find Windows Explorer, right-click it, and choose Restart — or just sign out and back in.
Stay safe: only edit keys under the shell locations listed above.
Never delete entire top-level hives or keys you don't understand, and always keep your
exported .reg backup.
Related guides
- How to remove items from the right-click menu in Windows 11
- How to add a program to the right-click menu
- How to restore the old context menu in Windows 11
Editing the context menu registry — FAQ
Is editing the registry dangerous?
The context menu keys are low-risk as long as you export a backup first and only edit the shell keys described here. Never delete keys you don't recognize, and always keep the .reg backup you exported.
What is the difference between *\shell and Directory\shell?
*\shell controls the menu that appears when you right-click files, while Directory\shell controls the menu for folders. Directory\background\shell controls the menu for empty desktop or folder space.
How do I disable a menu entry without deleting it?
Add a String Value named LegacyDisable (with any value) to the entry's key. The item stays in the registry but no longer appears in the menu. Delete the LegacyDisable value to bring it back.