Metadata-Version: 2.4
Name: windowsctxmenu
Version: 1.0.0
Summary: Add, remove and block Windows right-click context menu entries from Python.
Project-URL: Homepage, https://github.com/offerrall/windowsctxmenu
Project-URL: Repository, https://github.com/offerrall/windowsctxmenu
Author: windowsctxmenu authors
License: MIT License
        
        Copyright (c) 2026 Beltrán Offerrall
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: context-menu,registry,shell,windows,winreg
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# 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

```bash
pip install windowsctxmenu
```

## API

```python
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/`](examples) folder:

- [`examples/add.py`](examples/add.py) — add entries (open folder with VS Code,
  PowerShell here, ...).
- [`examples/remove.py`](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`.

```bash
switchmenu
```
