Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I refresh a Windows cmd shell after I modified my Environment variables?

i.e. in bash I can just do "source ~/.bashrc"

share|improve this question
There's a good answer to the same question on Stackoverflow. – Hugh Allen Apr 12 '10 at 10:40
Close the console and open a new one. – Synetech Feb 20 '12 at 1:38

1 Answer

that depends where you "set" your environment variables. the equivalent to your bash example would be like this:

file: env.bat

set FOO=bar

and now you refresh it

% call env.bat

but i think you have done it via the windows-system-settings-dialog (or whatever its name is). the result of this is that you have actually changed the registry. these registry settings are mapped into the process when you launch a new process.

so, you can either start a new process (cmd.exe in your case) OR you can read the registry keys reflecting the changes you want. you could also write a little .bat / .cmd script which gets the environment from the registry and changes the current enviroment accordlingy (if the mood strikes me i ll do this after lunch).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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