Win10 內建深色模式(夜間模式)但缺少快速切換開關,需深入設定或修改登錄。將切換邏輯封裝為 PowerShell 腳本(.ps1),右鍵「使用 PowerShell 執行」即可瞬間切換,再執行一次即還原。
ToggleDarkMode.ps1:$regkey = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
$name = "AppsUseLightTheme"
$exists = Get-ItemProperty -Path $regkey -Name $name -ErrorAction SilentlyContinue
if (($exists -ne $null) -and ($exists.$name -ne $null)) {
Remove-ItemProperty -Path $regkey -Name $name
} else {
New-ItemProperty -Path $regkey -Name $name -Value 0 -PropertyType DWORD -Force
}
ToggleDarkMode.ps1 → 「使用 PowerShell 執行」。
.ps1 放入 shell:sendto(傳送到選單)或建立捷徑指定快速鍵(如 Ctrl + Alt + D)。SystemUsesLightTheme 鍵值。深色模式下,作用中視窗標題列文字與按鈕變黑、難以辨識。此功能屬早期實作未完善,微軟後續版本(1809+)已在「設定 → 個人化 → 色彩」提供完整的「選擇模式」下拉選單(淺色/深色/自訂),建議優先使用內建介面。