Created
November 20, 2022 12:31
-
-
Save vctls/027f02644c582be9a4f6214150ea3d70 to your computer and use it in GitHub Desktop.
Powershell script to switch both app and system Windows light/dark theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switch Windows light/dark theme | |
$regkey = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" | |
$appProp = "AppsUseLightTheme" | |
$sysProp = "SystemUsesLightTheme" | |
$currVal = Get-ItemProperty -Path $regKey -Name $appProp | Select-Object -exp $appProp | |
$newVal = !$currVal + 0; | |
Set-ItemProperty -Path $regKey -Name $appProp -Value $newVal -Type Dword -Force; | |
Set-ItemProperty -Path $regKey -Name $sysProp -Value $newVal -Type Dword -Force; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment