小编Cod*_*Fox的帖子

如何以编程方式在 Windows 11 中启用浅色模式/深色模式?

我正在尝试使用任务计划程序在 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)

windows-registry powershell themes windows-11

6
推荐指数
1
解决办法
3491
查看次数

标签 统计

powershell ×1

themes ×1

windows-11 ×1

windows-registry ×1