Windows Installer package doesn't update system environment variables in Windows 10


After you install a Windows Installer package that updates a system environment variable in Windows 10, you find that although the system environment variable is updated in the elevated Command Prompt window, it isn't updated in the standard Command Prompt window.


This issue occurs because the environment block for the Explorer.exe process isn't updated.


To resolve this issue, apply the hotfix from the following Microsoft Knowledge Base article:


To work around this issue, install the Windows Installer package, log off of Windows, and then log on again.

More Information

For developers and IT professionals

To avoid this issue, you can use the following two APIs in an application, and then run the application alongside Windows Explorer to make sure Windows Shell receives the related message:

  • RegNotifyChangeKeyValue. Use this API to monitor the following registry key:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment

    When the registry key is changed, use SendNotifyMessageto send a broadcast WM_SETTINGCHANGE message that has lparam set to the "Environment" string.
  • CreateEnviornmentBlock. Use this API to start the new process by using this environment block. This prevents the application from inheriting the Explorer.exe environment block.
For more information, see Environment Variables.

Article ID: 3166232 - Last Review: Nov 1, 2016 - Revision: 1