Zend certified PHP/Magento developer

Why can’t I personalize Windows through registry?

I’m trying to schedule the light mode/dark mode in Windows personalization settings using Task scheduler.

these 2 keys are the only ones responsible for it.

# Set Windows Personalization, color settings, to enable Light mode for System
$RegistryPath = 'HKCU:SoftwareMicrosoftWindowsCurrentVersionThemesPersonalize'  
$Name         = 'SystemUsesLightTheme'  
$Value        = '1' 
If (-NOT (Test-Path $RegistryPath)) {   New-Item -Path $RegistryPath -Force | Out-Null } 
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force
# Set Windows Personalization, color settings, to enable Light mode for Apps
$RegistryPath = 'HKCU:SoftwareMicrosoftWindowsCurrentVersionThemesPersonalize'  
$Name         = 'AppsUseLightTheme'  
$Value        = '1' 
If (-NOT (Test-Path $RegistryPath)) {   New-Item -Path $RegistryPath -Force | Out-Null } 
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force

running that only partially changes the Windows theme from dark to light, like the taskbar and file explorer aren’t changed, but settings page itself and some other areas are changed.

what other component are responsible, other than registry, that perform these personalization tasks?

I’ve traced the settings process when changing the theme and no other registry key other than those 2 are modified.

changing the theme using settings is the only way that performs the theme change properly.

I noticed the same problem when trying to set and change night light using registry.