I know how to set system or user specific environment variables:

Windows Environment Variables

Now, the problem is that the PATH variable is treated such that the value you enter for the user PATH will be automatically appended to the system PATH and that will be the effective PATH variable.

That is, say I have

(SYSTEM) PATH=C:\Windows\System32;C:\Program Files\Foo\bin;...

and (USER) PATH=C:\Program Files\Bar\bin (note that there is not %PATH% in this value)

then the resulting environment variable for this user will be:

(effective) PATH=C:\Windows\System32;C:\Program Files\Foo\bin;...;C:\Program Files\Bar\bin

However, I would rather like that for this user the PATH environment variable should have the bar\bindirectory at the beginning of the PATH instead of at the end.

Is there a proper way to tell windows to completely override the PATH variable of a user with the value for that user instead of appending it to the system PATHvariable?

Note: Obviously, from a batch file, all this doesn't matter as you can set and tweak the env.vars as you like.

link|improve this question

48% accept rate
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.