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 anyway to change the PATH environment variable (or variables in general) on Windows 7 Exterprise (64 bit) and have it take effect in PowerShell or the command prompt (cmd.exe) without requiring a restart?

I don't mind having the reopen the shell/prompt, but having to restart is too much.

I'm currently changing variables through Advanced Systems settings ->Environment Variables`.

share|improve this question
up vote 21 down vote accepted

The requirement really isn't "must restart", it's "must log out/log back in" -- mostly for your current user processes to pick up the change.

If all you're interested in is for the variable changes to take effect in a command window or power shell, starting a new shell after making said changes should be all that's needed.

share|improve this answer
Its weird creating a new terminal/shell window after making changes always used to work on previous windows versions but it doesn't seem to be enough on Win7 :( – Danielb Nov 29 '09 at 19:27
Also programs (in my case NUnit) will often read the new path changes if you open and close them. – Matthew Lock Apr 2 '12 at 23:53
If use "Open Command Window Here" in explorer I can see the new path with echo %PATH% but not if I just run cmd.exe – Glenn Lawrence Mar 18 '14 at 6:06
@GlennLawrence for me it's the opposite: I see my changes if I invoke cmd from the Start menu (either by searching for it or by using the Run… function). If I invoke it from a batch file or from the context menu, I do not see my changes. – Saulo Silva Mar 31 '14 at 19:41
Make sure you restart the process creating cmd after changing the system environment variables. Killing explorer often does the trick. – masterxilo Feb 21 at 18:31

In my Win7 (64-bit) the console command


adds drive:\dir to the beginning of the current console's path without starting a new console. No idea why your Win7 should behave differently. I'd like to know how some programs add themselves to the %path% variable for every instance of the console, though.

To change the Windows 7 path manually, check:

share|improve this answer

I solved this problem by choosing Command Prompt or Windows PowerShell from the start menu, right clicking and choosing "Run as administrator". Then the new command window will recognize the changes to PATH, otherwise it does not. I don't know what will happen after a restart.

share|improve this answer

You must log in to answer this question.

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