Changed PATH in Registry but its not changed in Environment
Posted: Mon Aug 09, 2010 8:43 pm
Hi All.
I am writing an app which requires the addition of new directories to the environmental PATH variable.
So after successful creation of the new directories, I add the new directories to the registry PATH value at HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment.
But this new PATH setting does not reflect in the current environment. I have to reboot in order to get my changes recognized.
But if I add the directories to the PATH using Control Panel, the settings are saved to the Registry AND the current environment reflects the change. So somehow, the Control Panel is notifying the current environment of the change and the current environment updates its variables in memory accordingly.
What am I missing here? Is there a Windows API call I need to make to do this?
I am using Win XP SP3.
Thanks in advance for any help.
I am writing an app which requires the addition of new directories to the environmental PATH variable.
So after successful creation of the new directories, I add the new directories to the registry PATH value at HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment.
But this new PATH setting does not reflect in the current environment. I have to reboot in order to get my changes recognized.
But if I add the directories to the PATH using Control Panel, the settings are saved to the Registry AND the current environment reflects the change. So somehow, the Control Panel is notifying the current environment of the change and the current environment updates its variables in memory accordingly.
What am I missing here? Is there a Windows API call I need to make to do this?
I am using Win XP SP3.
Thanks in advance for any help.