Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to PATH do not persist #146

Closed
CumpsD opened this issue Feb 21, 2014 · 2 comments
Closed

Changes to PATH do not persist #146

CumpsD opened this issue Feb 21, 2014 · 2 comments

Comments

@CumpsD
Copy link
Contributor

CumpsD commented Feb 21, 2014

When changing the PATH variable from inside cmder, it does not get persisted to the real Windows environment variables.

I know cmder inject stuff into the PATH, wouldn't it make sense to keep track of what it injected before/after and strip that from the PATH and update the real PATH with that.

This issue is causing me to have scripts which modify the PATH to fail afterwards, since the PATH wasn't really updated, besides in that one instance

Repro:
echo %PATH%
set PATH=%PATH%;test
echo %PATH%

Close cmder
Reopen cmder

echo %PATH% -- No more test

@hopbit
Copy link

hopbit commented Feb 21, 2014

Have you tried something like this?

    setx MY_PATH "c:\a\b\c"
    setx PATH "%PATH%;MY_PATH%"

More info about setx can be found here:
http://technet.microsoft.com/pl-pl/library/cc755104(v=ws.10).aspx

@samvasko
Copy link
Contributor

As @hopbit pointed out set is only for local variables. So this behavior is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants