Wednesday, December 27, 2006

Windows environment variables

User specific environment variables are available only to the user for which it is created and System wide are available to all the users.

These environment variables are stored in the following registry location

You can modify user environment variables by editing the following Registry key: HKEY_CURRENT_USER \Environment

You can modify system environment variables by editing the following Registry key: HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Control \Session Manager \Environment

Note: If you modify the environment variables it won't reflect immediately till you log-off and log-in again.

Changes to environment variable

To effect the changes to the environment variable immediately without log off, broadcast the WM_SETTINGCHANGE message to all windows in the system, so the system will will peform read from registry again to update the environment variable.