Question

I am trying to add a path, in PATH variable. I run cmd.exe as administrator and used

setx PATH "%PATH%;C:\MinGW\bin"
setx PATH "%PATH%;C:\MinGW\msys\1.0\bin"

I then restarted my computer, but if I type path I don't see the paths that I set there. Note that with the exact same way I was able to set some other directories on PATH.

Any idea on what might be wrong?

Was it helpful?

Solution

you should use

"My Computer" > "Properties" > "Advanced" > "Environment Variables" > "Path".

OTHER TIPS

setx PATH "%PATH%;C:\MinGW\bin"
setx PATH "%PATH%;C:\MinGW\msys\1.0\bin"

Should first set PATH to "%PATH%;C:\MinGW\bin" and then to "%PATH%;C:\MinGW\msys\1.0\bin", so the second setx overrides the first because setx does not set the variable in the current or existing CMD sessions - only new ones.

setx PATH "%PATH%;C:\MinGW\bin;C:\MinGW\msys\1.0\bin"

theoretically should set PATH with those two directories appended - for future sessions.

You can check by simply starting a new session and executing a

path

command.

If the change doesn't survive a reboot, then some other process is resetting it.

If the change doesn't occur at all, then there's something mighty fishy going on. Possibly a typo...

I'd try setting some other variable as a test, say mypath.

You can delete a variable using

setx mypath ""

Googling for PATH EDITOR may be useful...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top