adding PATH with SETX or PATHMAN or something else?
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
(I know that you've already answered this question, but)
The problem with your usage of setx
is that you are not quoting the string that you want to be set. Because the ;
character is a command delimiter (you can string commands to be run in-succession with it), it thinks that you are setting path and then running another command.
What you should do is this:
setx /M path "C:\perl\bin;%path%"
This prepends my %path%
variable with C:\perl\bin
, because I want it to come before anything else that may be installed. The /M
means that I mean the System EnvVar, not the user's.
There are three which I know methods out of which one is permanent(when adding in environment variables) and other 2 r temp.. just for setting path and thus the path set by them is destroyed after cmd is terminated(closed). Starting with methods:-
-
Temporary method 1:-
setx PATH "%PATH%;c:\path name;"
-
Temporary method 2:-
set PATH=c:\path name;%PATH%
-
Permanent Method:-
pathed /append c:\path name /machine (for all users) pathed /append c:\path name /user (for current user)