Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way I can apply environment variables without rebooting on windows 7?

share|improve this question
I think you can log off and log back on again. – Breakthrough Aug 15 '11 at 10:31
up vote 5 down vote accepted

If you set an environment variable with the SET command in a command interpreter, it applies right there and then, to that process' environment. No rebooting, no logging off and on — nothing more required.

The environment variables that are held in the registry are not, in fact, environment variables at all. They are a template. Coöperating programs read from the template and create/modify their own actual environments from it. They know when the template changes because there's a windows message that is broadcast to all top-level windows to say that this has happened. You need to broadcast that message. All coöperating programs, including Windows Explorer, will re-read the template and adjust their environments, that will be inherited by any new processes that they spawn from that point onwards, accordingly.

share|improve this answer
You are perfectly correct, however, some applications may need to be restarted - if they read (and cache) environment variables, they may not be aware of changes. But rarely should that ever mean that a reboot is required. – CJM Aug 15 '11 at 15:14
Restarting the program which was accessing the environment variable did the trick for me! – enderland Aug 11 '15 at 13:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .