Skip to content

Latest commit

 

History

History
63 lines (45 loc) · 1.86 KB

File metadata and controls

63 lines (45 loc) · 1.86 KB

windowsctxmenu

Get your Windows right-click menu exactly the way you want it, from Python.

The idea: you write one script with your setup (what to remove, what to add, what to block) and carry it to every new PC or every reinstall. Run it and your context menu is identical everywhere — no manual registry editing.

Requirements

  • Windows 11
  • Python >= 3.10

Installation

pip install windowsctxmenu

API

from windowsctxmenu import (
    add_shell, add_handler, unblock,
    remove_shell, remove_handler, remove_shellnew, block,
)
Function What it does
add_shell(name, command, ...) Add a classic verb under ...\shell
add_handler(name, clsid, ...) Add a COM handler
unblock(name_or_clsid) Unblock a blocked CLSID
remove_shell(name, ...) Remove a classic verb
remove_handler(name, ...) Remove a COM handler
remove_shellnew(key_path) Remove an entry from the "New" submenu
block(name_or_clsid) Block a built-in element by CLSID

scope: file, directory, background, folder, drive, allfiles, all, an extension (.zip), a ProgID glob (VLC.*), or sfa:<glob>.

Writing to HKLM (shared across users) requires running as administrator; otherwise the action is reported as no-permission and continues.

Examples

Everything is in the examples/ folder:

Copy one, tweak it to taste, and that's your per-PC script.

switchmenu command

Toggle the right-click menu between the classic (Windows 10) and the new (Windows 11) one. Restarts Explorer to apply instantly. No administrator needed: everything lives under HKEY_CURRENT_USER.

switchmenu