Archive: Path Manipulation - Windows 2000


Path Manipulation - Windows 2000
I am having a problem with the Path Manipulation function on a Windows 2000 machine. The installer runs successfully, but even after a reboot the path does not get added [System Properties --> Advanced Tab --> Environment Variables]. In this particular case the PATH variable doesn't exist at all. Any ideas as to why this might be happening? Thanks.


OK, the user installed as an Admin, but then changed to a Power User. So the Path gets set for whoever you are when you install, but not for other users I guess.

So, if I change the path manip function so that it writes the path key to HKLM instead of HKCU, wouldn't that do the trick? Is there a reason not to do it that way?


I think that should work. Try it :)


Almost. It should be HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment".


Originally posted by kichik
Almost. It should be HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment".
works great

A few more questions about this.

Which Sendmessage should I use given that I am going to right to HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"?

SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000

SendMessage ${HWND_BROADCAST} ${WM_SETTINGCHANGE} 0 "STR:Environment" /TIMEOUT=5000

What is the difference between WM_WININICHANGE and WM_SETTINGCHANGE?


WM_SETTINGCHANGE is the exact same thing as WM_WININICHANGE. It's even defined this way in MSVC's header files:

#define WM_SETTINGCHANGE           WM_WININICHANGE