Update Windows Path Without Rebooting
I find it quite annoying that whenever I read instructions that include adding an environment path variable you are asked to reboot your machine for changes to take effect. I know there has GOT to be a way to do it. Well, I know a way, but it’s someway kludgy.
Here is how I do it (I’m really hoping someone will comment and tell me a better way)
- Open your system properties window. Screenshots below are for Vista:
- Open you Environment Variables Window.
- Double Click on you Path (if you want to just change you path for your login, use the top one, if you want to change it for all logins, use the bottom one)
- Append the path you would like to add, separated with a semi-colon. Below, I am adding C:\CmdShortcuts

…
Now, reboot your computer! Argh! J/K
Here is the kludgy hack that I use so I don’t have to reboot. (But it will not work in all cases, which is why I don’t like it, so please, if you know of a batch script or something I can run that will apply the changes made to the environment variables without reboot, please post a comment.)
Open a comment window and type SET PATH=%PATH%;C:\CmdShortcuts
You can type PATH again to see your path variables. Your new path should be added. The problem with this is that this new path variable is only good inside this command window. If you are doing command line stuff this works, but if you close your cmd window the change is lost.
Related posts:
- Pidgin Crashing on Windows 7 64-bit – Fixed Ever since installing Windows 7 RC, I have not been...
- Django: Login Form on Every Page Up to the point, when it has come to Django...
- Django cron on Webfaction James Bennett addresses one of the most frequently asked questions...
- Inconsistent Bugs and Hard Coded Variables Part of the joys of being a one man development...
Related posts brought to you by Yet Another Related Posts Plugin.
June 19, 2008
Tags: cmd, command, path, windows Posted in: Programming & Internet




3 Responses
if you Update Windows Path variables and click ok. they donot show up but if you end explorer.exe task and run a new explorer.exe task up it will now refresh with the new path variable
from http://support.microsoft.com/?kbid=104011
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) “Environment”, SMTO_ABORTIFHUNG, 5000, &dwReturnValue);
note: this is not a complete solution. if you add a string to the PATH, it will propogate just fine, but if you add another environment variable (%MYAPP_PATH%, e.g.) it will not be expanded, i believe this is due to a bug in shell32.dll which is alluded to here:
http://support.microsoft.com/kb/329308
I’m not sure if this works for Vista but I know for sure this worked for me on XP SP3. What I did was followed steps 1-4 above and ran SET PATH=%PATH%;C:\CmdShortcuts in a cmd window.
Exit the cmd session and open another cdm window typed echo %path% to verify C:\CmdShortcuts was still there.
Comments are closed for this entry.