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:
examples/add.py— add entries (open folder with VS Code, PowerShell here, ...).examples/remove.py— full menu cleanup.
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
Release files for windowsctxmenu 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| windowsctxmenu-1.0.0.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| windowsctxmenu-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.5 kB