A lightweight PowerShell script to manage portable CLI tools on Windows without cluttering your System PATH variable.
If you use many portable tools (like ffmpeg, ngrok, aria2, scrcpy), you typically have two bad options:
- Cluttering PATH: Adding 10+ different folders to your System Environment Variables.
- Duplicating files: Copying all
.exefiles into a singleC:\binfolder (which breaks updates and dll dependencies).
Win CLI Linker allows you to keep your tools organized in their original folders (e.g., on a secondary drive D:\Tools\...).
It automatically generates small .bat shims (wrappers) in a single directory (e.g., C:\P). You only need to add this one directory to your PATH.
- Zero Dependencies: Just a single PowerShell script.
- Clean PATH: Only one entry in your environment variables.
- Argument Passing: Correctly passes all arguments (e.g.,
ffmpeg -i ...) to the target executable. - Environment Variables: Supports paths like
%USERPROFILE%\Downloads\....
- Choose a folder for your shims (Default is
C:\P). - Add this folder to your Windows PATH environment variable.
- Search "Edit the system environment variables" -> "Environment Variables" -> Select "Path" -> "Edit" -> "New" -> Add
C:\P.
- Search "Edit the system environment variables" -> "Environment Variables" -> Select "Path" -> "Edit" -> "New" -> Add
Open update-shims.ps1 and edit the configuration section. Add your tools to the $Tools list:
$ShimDir = "C:\P"
$Tools = @{
# "CommandName" = "Path\To\Original\Executable.exe"
"ngrok" = "D:\tools\ngrok.exe"
"ffmpeg" = "D:\tools\ffmpeg\bin\ffmpeg.exe"
"ffprobe" = "D:\tools\ffmpeg\bin\ffprobe.exe"
"my-tool" = "%USERPROFILE%\Downloads\tool.exe"
}
Double-click update-shims.ps1.
It will create (or update) the .bat files in your shim directory.
[OK] ngrok
[OK] ffmpeg
[OK] ffprobe
Done. Press Enter to exit...
Now you can open any terminal (CMD, PowerShell, Git Bash) and type ffmpeg or ngrok from anywhere.
MIT License. Feel free to use and modify.