Registry keys inside HKEY_CURRENT_USER namespace are not (always) being integrated

Kjell

Member
I've noticed that certain registry keys for HKEY_CURRENT_USER aren't being integrated at all when the file .reg file is added in Integrate > Registry. Here's a example for Windows 11 (22H1):
Code:
Windows Registry Editor Version 5.00

; Remove default pinned objects in quick settings
[HKEY_CURRENT_USER\Control Panel\Quick Actions\Control Center\Unpinned]
"Microsoft.QuickAction.Accessibility"=hex(0):
"Microsoft.QuickAction.BlueLightReduction"=hex(0):
"Microsoft.QuickAction.Cast"=hex(0):
"Microsoft.QuickAction.InputSwitcher"=hex(0):
"Microsoft.QuickAction.Project"=hex(0):
"Microsoft.QuickAction.QuietHours"=hex(0):
This code only works if it's executed manually (after Windows has been setup). It removes all pinned objects in Quick Actions menu.

Is there any way we can delay certain registry changes for post-setup (first though in my mind is just running a lot of batch commands but that would be quite ineffective)?
 
HKCU registry keys are tricky, because some keys are overwritten when the user is provisioned.

The problem isn't that your keys aren't integrated, but many user profile settings are reset during user provisioning (for the desktop and Appx packages). Before OOBE runs, there are no user accounts. HKCU keys are normally assigned to Default User's NTUSER.dat hive.

Confirm this by mounting the image, and regedit loading its hive.

New user accounts will inherit Default User's keys. But user provisioning will reset many desktop personalization values.
There's no list of what keys get clobbered, you just have to experiment.

The answer is to move the HKCU reg file to Post-Setup (User - Execution) to guarantee it always works.
 
I've noticed that certain registry keys for HKEY_CURRENT_USER aren't being integrated at all when the file .reg file is added in Integrate > Registry.
This code only works if it's executed manually (after Windows has been setup). It removes all pinned objects in Quick Actions menu.

Is there any way we can delay certain registry changes for post-setup (first though in my mind is just running a lot of batch commands but that would be quite ineffective)?
You can add the call to runonce in HKCU to be added on first logon and the reg file to $oem$\$$\system32.

There are other options but this one works.
 
Back
Top