https://github.com/jonasgeiler/pathix
A simple Powershell script to clean up your PATH on Windows
https://github.com/jonasgeiler/pathix
cleaner cleanup cli fix path powershell shortener tool windows
Last synced: 3 months ago
JSON representation
A simple Powershell script to clean up your PATH on Windows
- Host: GitHub
- URL: https://github.com/jonasgeiler/pathix
- Owner: jonasgeiler
- Created: 2022-03-05T23:55:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-06T00:02:09.000Z (over 3 years ago)
- Last Synced: 2025-06-22T23:46:05.087Z (4 months ago)
- Topics: cleaner, cleanup, cli, fix, path, powershell, shortener, tool, windows
- Language: PowerShell
- Homepage:
- Size: 2.93 KB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pathix
A simple Powershell script to clean up your PATH on Windows
## What it does
- Move entries to their correct target
- Entries in the current user's PATH that are relevant for all users go to the system's PATH
- Entries in the system's PATH that are only relevant for the current user go to the user's PATH
- Remove redundant entries
- Duplicate entries in the current user's PATH
- Duplicate entries in the system's PATH
- Entries in the current user's PATH that already exist in the system's PATH
- Remove or fix broken entries
- Try to replace `C:\Program Files` with `C:\Program Files (x86)` in the entry and visa-versa
- Otherwise, remove them
- Shorten entries
- Try to replace parts of the entry with another environment variable (f.e. `C:\Program Files` with `%ProgramFiles%`)
- Normalize paths and remove redundant path separators at the end
- Sort entries
- Prepend `%SystemRoot%` to both PATHs so they correctly show up as a list when editing in control panel## How to use
Open PowerShell as Administrator and run:
```powershell
./pathix.ps1
```
> NOTE: Further information and instructions will be written to console.