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
Metadata
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 | Provenance | Actions |
|---|---|---|---|---|
| windowsctxmenu-1.0.0.tar.gz | 6.7 kB | Without provenance | Details for windowsctxmenu-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| windowsctxmenu-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for windowsctxmenu-1.0.0-py3-none-any.whl |
Total release size: 15.5 kB
Security for windowsctxmenu 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.