By following the below instruction, you can create a right click context menu saying "Add to PATH" whenever you right click on a folder/directory
- Save
AddPath.ps1
toC:\cmdhost
- Click here to download the icon file. Save this file to
F:\icons\AddPath.ico
- Download
AddPath-Menu.reg
- Run
AddPath-Menu.reg
by double clicking it
Note 1: If you are not saving the files in the locations mentioned, update the reg file accordingly to reflect the actual file locations
Note 2: The below configuration only shows the menu on Shift
+Right Click
. If you want the menu to be visible in plain Right Click
,
remove all "Extended"=""
from the reg file
Note 3: The new path entries are always added to the end of $PATH variable
- Loss protection: You don't have to worry about losing your PATH variable, since
AddPath.ps1
creates backup atC:\cmdhost\.env_path_backup
before altering the $PATH variable. So you could manually restore anytime, if the script fails and corrupts your $PATH - Duplicate prevention: No duplicate paths will be added to your $PATH since whenever you add a path the script checks whether the path already exists before altering the $PATH