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

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

link|improve this question

53% accept rate
Close the console and open a new one. – Synetech Feb 20 at 1:38
feedback

2 Answers

There's a good answer to the same question on Stackoverflow.

link|improve this answer
feedback

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).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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