I am trying to add a PATH from command line, as with SETX %PATH%... it always expands the PATH, which I don't want.

PATHMAN is exactly for this purpose, but it doesn't work for me on Windows 7. It freezes most of the times, and it doesn't check for duplicated.

There must be a tool for managing PATH variables in the proper way. SETX would be perfect, but maybe not with the %PATH% syntax.

link|improve this question

feedback

1 Answer

up vote 3 down vote accepted

See the article Edit the PATH environment variable in Windows without pain.

It recommends using pathed :

For example, say that you have your Sysinternal tools in C:\Bin\Sysinternals and you want to add them to the PATH. Simply do:

pathed /append C:\Bin\Sysinternals /machine

If you want to add them to the user PATH system instead, then do:

pathed /append C:\Bin\Sysinternals /user
link|improve this answer
This is exactly what I was looking for! From the article, I have tried the other 3 solutions already without happiness. It seems this is the one I was looking for. Works perfectly! BTW, it has nothing to do with Sysinternals. – zsero Apr 8 '11 at 16:27
This is supposed to work but it has an essential bug, if you try to ADD/APPEND something to the the user path and user path is not defined the utility will fail to add the path. – Sorin Sbarnea Sep 21 '11 at 14:22
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.