Skip to main content

Add, remove and block Windows right-click context menu entries from Python.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

windowsctxmenu-1.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

windowsctxmenu-1.0.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file windowsctxmenu-1.0.0.tar.gz.

File metadata

  • Download URL: windowsctxmenu-1.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for windowsctxmenu-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6e9b3341bc3d13f08e28bbee069fa9c3c5e5eb33e9b5f86bf6b2f9cbceba74cb
MD5 287fa95379cc8106d99c630019e81e6b
BLAKE2b-256 4fa3232691e509f6e433aaa8d7fd28f00b9f149376592722fa74958a7d9949ce

See more details on using hashes here.

File details

Details for the file windowsctxmenu-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: windowsctxmenu-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for windowsctxmenu-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c04d96864716b58421b3bccb711b105da67000c52dea167fca7ed9af60d0054b
MD5 174d9c62333b029447ccb1e537d81b33
BLAKE2b-256 0d554004dc9c34d4b47aef974745c9b86df5adeac62a78a9003acc7d8d241eac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page