Skip to content

Instantly share code, notes, and snippets.

@vctls
Created November 20, 2022 12:31
Show Gist options
  • Save vctls/027f02644c582be9a4f6214150ea3d70 to your computer and use it in GitHub Desktop.
Save vctls/027f02644c582be9a4f6214150ea3d70 to your computer and use it in GitHub Desktop.
Powershell script to switch both app and system Windows light/dark theme
# 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