2

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.

3

4 Answers 4

4

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

1

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.

1

You could just type "SETX" "ENV_VAR" "Value" on command-prompt to set new enviroment variables on Windows.

4
  • 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.
    – Diogo
    Jul 2, 2012 at 20:02
  • Good one, also mentioned in the answer over at SO I referenced. +1 :) Jul 2, 2012 at 21:46
  • 1
    You want users to NUKE their existing path with this? Terrible idea. They could however try SETX PATH %PATH%;c:\new\path
    – Warren P
    Oct 19, 2016 at 15:50
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .