A mouse-enabled terminal UI (TUI) tool for managing Windows USER and SYSTEM PATH environment variables on Windows 10/11.
Built with Textual — click buttons, navigate with keyboard shortcuts, or use both.
| Feature | Description |
|---|---|
| Load USER / SYSTEM PATH | Read directly from the Windows registry |
| Duplicate Detection | Highlights duplicate entries in yellow |
| Invalid Path Detection | Highlights missing/nonexistent paths in red |
| Remove Duplicates | One-click removal of all duplicate entries |
| Remove Invalid | One-click removal of all missing paths |
| Move Paths | Reorder entries by specifying source and destination positions |
| Add / Remove Paths | Add new entries or remove selected ones with confirmation |
| Expanded View | Toggle to see %VAR% references expanded to their actual values |
| Save to Registry | Write changes back with auto-backup and WM_SETTINGCHANGE broadcast |
| Backup / Restore | Export PATH entries to a text file or restore from one |
| UAC Elevation | Automatically requests admin privileges for SYSTEM PATH saves |
| Splash Screen | ASCII art banner on startup |
┌─────────────────────────────────────────────────────────┐
│ WinPath Manager — USER PATH (20 entries) │
├──────────────┬──────────────────────────────────────────┤
│ ── View ── │ # │ Path │ Status │
│ Load USER │ 1 │ C:\Windows\system32 │ OK │
│ Load SYSTEM │ 2 │ C:\Windows │ OK │
│ Refresh │ 3 │ C:\bad\path │ MISSING │
│ Expanded │ 4 │ C:\Windows\system32 │ DUP │
│──────────────│ │ │ │
│ ── Edit ── │ │ │ │
│ Remove Dupes │ │ │ │
│ Remove Inv. │ │ │ │
│ Move a Path │ │ │ │
│ Add a Path │ │ │ │
│ Remove Sel. │ │ │ │
│──────────────│ │ │ │
│ ── Save ── │ │ │ │
│ Save to Reg │ │ │ │
│ Backup │ │ │ │
│ Restore │ │ │ │
│──────────────│ │ │ │
│ Exit │ │ │ │
├──────────────┴──────────────────────────────────────────┤
│ q Quit · u USER · y SYSTEM · Ctrl+S Save · e Expanded │
└─────────────────────────────────────────────────────────┘
- Python 3.10+ (uses
X | Yunion syntax) - Windows 10 or 11
- Windows Terminal (recommended — provides the best window size and rendering)
- Dependencies:
textual>=1.0,rich>=13.0— installed automatically on first run if missing
No installation needed. WinPath.cmd is a single self-contained file — a polyglot that works as both a Windows batch launcher and a Python script.
- Download or clone the repository
- Double-click
WinPath.cmdfrom Explorer
On first run, if textual or rich are not installed, WinPath will offer to install them automatically via pip.
Build a self-contained executable with PyInstaller:
pip install pyinstaller
pyinstaller --clean --onedir --name WinPath --collect-all textual WinPath.cmdThis produces a dist\WinPath\ folder. Copy that folder anywhere — no Python needed on the target machine. Run dist\WinPath\WinPath.exe directly, or use the included Launch-WinPath.cmd to open it in a properly-sized Windows Terminal window.
Why
--onedir? The alternative--onefilebundles everything into a single.exebut extracts to a temp directory on every launch, leaving the launch window visible for ~15 seconds on exit.--onedirhas no such overhead.
Double-click WinPath.cmd from Explorer (source) or Launch-WinPath.cmd (exe build) — either opens a properly-sized Windows Terminal window and launches the app.
To run from a terminal:
# Source
python WinPath.cmd
# Exe build
dist\WinPath\WinPath.exeClick any button in the sidebar to execute that action. Click rows in the path table to select them for removal or inspection.
| Key | Action |
|---|---|
u |
Load USER PATH |
y |
Load SYSTEM PATH |
Ctrl+S |
Save to registry |
e |
Toggle expanded view |
d |
Remove duplicates |
i |
Remove invalid paths |
q |
Quit |
| Flag | Description |
|---|---|
--save-system <path_string> |
Internal flag used for elevated SYSTEM PATH writes via UAC |
-
Registry Access — Reads/writes
HKCU\Environment\Path(USER) andHKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path(SYSTEM) usingwinreg. Preserves theREG_EXPAND_SZtype. -
Environment Broadcast — After saving, sends
WM_SETTINGCHANGEviaSendMessageTimeoutWso running applications pick up the new PATH without a reboot. -
UAC Elevation — SYSTEM PATH requires admin. WinPath detects this and re-launches itself elevated via
ShellExecuteW("runas", ...)with a--save-systemflag to complete the write. -
Auto-Backup — Every save automatically creates a timestamped backup file (
PATH_USER_20260514_150000_autosave.txt) before writing to the registry.
WinPath/
├── WinPath.cmd # Single-file launcher + app (polyglot batch/Python) - requires Python
├── winpath.py # Python-only source (without batch header)
├── Launch-WinPath.cmd # Launcher for the exe build (opens WT at the right size)
├── WinPath-Launcher.cmd # Alternative launcher for the exe build
├── winpath-POC.py # Original CLI proof-of-concept (keyboard only)
├── requirements.txt # Python dependencies (for manual installs)
├── README.md # This file
└── index.html # Product page
WinPath.cmd is a valid Windows batch script and a valid Python script at the same time. The first three lines use the # comment trick:
- Batch sees:
#fails silently,||triggers the real command — opens Windows Terminal at the right size then exits - Python sees: lines starting with
#are comments — ignored completely, app runs normally
This means you only need to distribute one file.
Paul R. Charovkine — 2026
MIT