Using the CopyHKCUSettingsFromOtherUsers Fix

Applies To: Windows 7, Windows Vista

This section includes information about using the CopyHKCUSettingsFromOtherUsers compatibility fix, including its associated issues, available command-line options, and usage.

CopyHKCUSettingsFromOtherUsers

The CopyHKCUSettingsFromOtherUsers compatibility fix enables you to fix applications by searching for and copying registry settings from another user’s HKEY_USERS registry keys into the current user’s HKEY_USERS registry keys, if they are not located there.

This fix is implemented so that you can apply it only to an application that is running with Administrator privileges. Because of this restriction, the most common scenario for applying this fix is to a Setup.exe file. For example, if the Setup.exe file is reading values from the HKEY_CURRENT_USER registry keys, and the file cannot find data from the existing user, then the application might have problems later during an upgrade or repair process. This will most likely be the case if you installed the application while running as an Administrator but before you enabled the User Account Control (UAC), or if you installed the application on a previous version of Windows®.

Investigating the Issue

The CopyHKCUSettingsFromOtherUsers compatibility fix should be considered as a possible resolution if you are using an elevated application that is looking at the HKEY_CURRENT_USER registry keys and is running on a different user account than the original account used to install the program. You can investigate the registry-related issues by using registry-monitoring tools such as the Process Monitor. If the problem seems to be fixed by inserting a copy of the affected registry keys into the current user account, then this compatibility fix should also fix the problem.

Intercepted APIs

There are no intercepted APIs. Instead, the applicable registry keys are copied when the application is run.

CopyHKCUSettingsFromOtherUsers Command-Line Options

The following table provides details for the available command-line option, including its usage.

Option Description

caret ("^") delimited list

Provides a caret-delimited list of registry keys relative to the HKEY_CURRENT_USER keys. For example, the following command will copy two keys from another user profile to the current user profile: CopyHKCUSettingsFromOtherUsers Software\Microsoft\VisualStudio\9.0\General\Animations ^Software\Microsoft\VisualStudio\9.0\General\OnRun

Fixing Your Code

Applications should be modified so as not to apply per-user settings while elevated. In addition, you should consider whether to apply settings to the per-user or per-computer registry for any application that administers the computer or requires Administrator privileges.

See Also

Concepts

Windows Vista and Windows 7 Operating Systems