Skip to content

Instantly share code, notes, and snippets.

@mark05e
Last active August 3, 2024 12:03
Show Gist options
  • Save mark05e/6731c38446241f8907932a6146d50463 to your computer and use it in GitHub Desktop.
Save mark05e/6731c38446241f8907932a6146d50463 to your computer and use it in GitHub Desktop.
Enable dark/light mode in Windows 10 (tested on build 18363) through CLI. Make sure to update <<MODIFY_USERNAME_HERE>> with value from your registry.
REM **For Windows 10**
powershell.exe Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0
powershell.exe Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 0
REM **For Office 2016**
powershell.exe Set-ItemProperty -Path HKCU:\Software\Microsoft\Office\16.0\Common -Name 'UI Theme' -Value 4
powershell.exe Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\16.0\Common\Roaming\Identities\<<MODIFY_USERNAME_HERE>>\Settings\1186\{00000000-0000-0000-0000-000000000000}\PendingChanges' -Name 'Data' -Value ([byte[]](4, 0, 0, 0)) -Type Binary
REM ref: https://www.cloudappie.nl/change-theme-officeproplus-powershell/ for Office 2016
REM **For Windows 10**
powershell.exe Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 1
powershell.exe Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 1
REM **For Office 2016**
powershell.exe Set-ItemProperty -Path HKCU:\Software\Microsoft\Office\16.0\Common -Name 'UI Theme' -Value 0
powershell.exe Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\16.0\Common\Roaming\Identities\<<MODIFY_USERNAME_HERE>>\Settings\1186\{00000000-0000-0000-0000-000000000000}\PendingChanges' -Name 'Data' -Value ([byte[]](0, 0, 0, 0)) -Type Binary
REM ref: https://www.cloudappie.nl/change-theme-officeproplus-powershell/ for Office 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment