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-clickRegistry key
FilesHKEY_CLASSES_ROOT\*\shell
FoldersHKEY_CLASSES_ROOT\Directory\shell
Desktop / empty spaceHKEY_CLASSES_ROOT\Directory\background\shell
DrivesHKEY_CLASSES_ROOT\Drive\shell

Step 1: Back up before you edit

  1. Press Windows + R, type regedit, and press Enter. Click Yes if prompted.
  2. Navigate to the key you plan to edit.
  3. Right-click that key in the left pane and choose Export.
  4. 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

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

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.