我正在尝试使用任务计划程序在 Windows 个性化设置中安排浅色模式/深色模式,以便 Windows 主题颜色会根据一天中的时间而变化,这对眼睛也更好。
这两个键是唯一负责它的:
# Set Windows Personalization, color settings, to enable Light mode for System
$RegistryPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize'
$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:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize'
$Name = 'AppsUseLightTheme'
$Value = '1'
If (-NOT (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | …Run Code Online (Sandbox Code Playgroud)