Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

Symptoms

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.

↑ Back to the top


Cause

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

↑ Back to the top


Resolution

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

http://support.microsoft.com/kb/3193821

↑ Back to the top


Workaround

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

↑ Back to the top


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.

↑ Back to the top


Keywords: kbexpertiseadvanced, kbsurveynew, kbtshoot, kb

↑ Back to the top

Article Info
Article ID : 3166232
Revision : 1
Created on : 1/7/2017
Published on : 11/1/2016
Exists online : False
Views : 622