Updating path variable Hot text chat rooms
Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange I would like to add an Environment variable to a Windows machine (desktop or server) and be able to use it without rebooting that machine. Changes to environment variables should take effect immediately, if you make the change via the main Properties dialog for the computer in question (go to My Computer | Properties | Advanced | Environment Variables).
For example for Apache service this works without any problems.
To change service account open console, select service, click service properties and on second tab enter logon credentials for a user.
That does not imply that Explorer broadcasts a WM_SETTINGCHANGE message once you have changed the system environment variables, or that it actually works. On the left pane, press 'Advanced System Settings' 3.
I'm not sure how you would do what is suggested in the KB article (to propagate the changes immediately) from the command prompt. On the 'Advanced' tab, click 'Environment Variables' 4.
The kb article linked to in that answer actually states that: However, note that modifications to the environment variables do not result in immediate change.
Also note that running services as normal user account might create security risks.Say you have a production server which hosts a variety of apps and a new app needs a particular Environment variable to run. After the changes are saved, Explorer broadcasts a message to all windows to inform them of the change.You do not want to reboot it while users are connected to your other apps. I don't like the wait-until-a-good-time-to-reboot option. Any programs spawned via Explorer after this should get the updated environment, although already-running programs will not, unless they handle the setting change message.We recycle our services and everything goes back to normal. But, again the concat in the PATH variable happens every hour .....