I have a feeling I should be able add a directory to the PATH environment variable on an application-lifetime basis, but I can't find out how to do this. Is it possible to add a parameter to a Windows shortcut that appends a directory to the current value of PATH for use by the application being linked?
Environment Variables Shortcut To have a quick access you can create a shortcut to the environment variables editor. Right click on the empty space of your desktop and select New -> Shortcut from the context menu. Set “Environment Variables” as the name of the shortcut and click on Finish .
On the Advanced tab, click Environment Variables. Click New to create a new environment variable. Click Edit to modify an existing environment variable. After creating or modifying the environment variable, click Apply and then OK to have the change take effect.
Press the Windows key + X to access the Power User Task Menu. In the Power User Task Menu, select the System option. Click the Advanced System Settings link in the left column. In the System Properties window, click the Advanced tab, then click the Environment Variables button near the bottom of that tab.
As explained here: http://www.labs64.com/blog/2012/06/set-environment-variables-in-windows-shortcut/ you can do it without a bat file too.
Set Target to e.g.:
C:\Windows\System32\cmd.exe /c "SET path=%path%&& START /D ^"C:\Program Files (x86)\Notepad++^" notepad++.exe"
To avoid see the command prompt for a split second before it close again, you should set
Run: Minimized
on the Shortcut tab
(Tested on Windows 7, Windows 10)
Let the shortcut execute a batch file (.cmd), that
Should look like this:
@echo off set path=%path%;C:\My Folder start "Window Title" "Path to my exe"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With