Microsoft's Windows
The Power Shell: Window's New-Fangled Shell*
[...]
Adding a directory to the PATH environment variable in Windows
- Change
PATH
with the GUI -
- Open Start Search, type
env
, and selectEdit the system environment variables
. - Click the
Environment Variables…
button. - In the
System Variables
section, locatePath
, and click edit. - In the
Edit environment variable
UI, clickNew
to add the new path.
After you change PATH with the GUI, close and reopen the console window. This works because only programs started after the change will "see" the new PATH. This is because when you change the PATH environment variable using the GUI tool, it updates the variable for future processes but not for anything currently running.
- Open Start Search, type
- Use the command line (
set
): -
This option only affects your current shell session, not the whole system. Execute this command in the command window you have open:
set PATH=%PATH%;C:<ANOTHER_PATH>
- Use the command line (
xset
): -
You can permanently add a path to PATH with the setx command:
setx /M path "%path%;<ANOTHER_PATH>"
Remove the
/M
flag if you want to set the user PATH instead of the system PATH.