While installing a third-party software, it asks me to add something to the PATH environment to the operating system. How to do that under Windows 7.
-
I do this using Rapid Environment Editor which is a bit easier than using the rather small Window UI– David HeffernanJul 2, 2012 at 20:50
-
Windows 10 finally has a decent user interface for this.– Warren POct 19, 2016 at 15:40
-
Windows 10 UI picture: i.stack.imgur.com/JphSc.png– Warren POct 19, 2016 at 15:50
4 Answers
Start > Control Panel > System > System Properties > Advanced > Environment Variables
Go to the box at the bottom and scroll down to where it says: PATH Highlight it, click edit, and append your new PATH data to the string. Be sure to add a semi-colon at the end before adding your new string. Look at the rest of the PATH string to understand this.
If you use a console or an app that depends on the path, you will have to restart it for the change to take effect
In addition to the existing answer I think it is noteworthy to point out the registry locations. The global environment variables are stored in:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
the user-specific ones are stored in:
HKEY_CURRENT_USER\Environment
(or HKEY_USERS\<USER-SID>\Environment
, in case you want to modify it for other logged-on users).
Refer to this question and the accepted answer for how to tell all running programs that you changed the environment. This is done by broadcasting a special window message.
You could just type "SETX" "ENV_VAR" "Value"
on command-prompt to set new enviroment variables on Windows.
-
That is untrue. It will actually only affect the current process (usually the command processor
cmd.exe
in this case) and its sub-processes. It won't affect the system or even the user variables in any way outside that scope. Jul 2, 2012 at 19:46 -
@STATUS_ACCESS_DENIED ops, that is true, edited it to SETX command, which is permanent.– DiogoJul 2, 2012 at 20:02
-
Good one, also mentioned in the answer over at SO I referenced. +1 :) Jul 2, 2012 at 21:46
-
1You want users to NUKE their existing path with this? Terrible idea. They could however try
SETX PATH %PATH%;c:\new\path
– Warren POct 19, 2016 at 15:50
You asked for software, so may I recommend EnvMan.
I use it all the time, and it provides a nice way to manage your path. Make sure to run it as administrator.