Quick fix: Windows 11 has no built-in scheduled theme switching, but Task Scheduler plus a two-line PowerShell script that flips the AppsUseLightTheme and SystemUsesLightTheme registry values gives you light at sunrise and dark at sunset without any third-party app.
macOS and most phones switch their UI between light and dark automatically as the day progresses. Windows 11 ships with both themes but treats them as a single toggle in Personalization — no schedule, no sunrise/sunset awareness. Microsoft briefly previewed a schedule feature in an Insider build years ago and never shipped it. The good news is that the two registry values that control the toggle are well-documented, and Task Scheduler can flip them on whatever trigger you like.
Affects: Windows 11, any edition.
Fix time: 15 minutes for the initial setup; runs automatically afterward.
What controls the theme switch under the hood
The Personalization page in Settings doesn’t do anything mysterious. When you change Choose your mode, Windows writes two DWORDs under HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize: AppsUseLightTheme (governs Settings, File Explorer, modern apps) and SystemUsesLightTheme (governs Start, taskbar, and the action center). Setting both to 1 is the light theme; 0 for both is dark. Mixed values (apps light, system dark) are valid and Windows applies them immediately.
Because there’s no exposed API and no event log for “mode changed,” the simplest automation path is Task Scheduler running a tiny PowerShell script at the times you want. Apps that observe the registry key (which is most of them) flip immediately. A handful of older apps need a relaunch to pick up the change.
Method 1: Schedule two PowerShell tasks for fixed times
- Open Notepad and paste this into a new file:
$path = “HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize”
Set-ItemProperty -Path $path -Name AppsUseLightTheme -Value 1
Set-ItemProperty -Path $path -Name SystemUsesLightTheme -Value 1 - Save it as
C:\Users\<you>\theme-light.ps1. - Duplicate the file, change the two
Value 1entries toValue 0, and save it astheme-dark.ps1in the same folder. - Open Task Scheduler (search Start). In the Actions pane click Create Task.
- On the General tab, name the task Theme – Light, set Run only when user is logged on, and check Run with highest privileges.
- On the Triggers tab, click New, set Daily at
07:00, and save. - On the Actions tab, click New. Action: Start a program. Program:
powershell.exe. Arguments:-ExecutionPolicy Bypass -WindowStyle Hidden -File "C:\Users\<you>\theme-light.ps1". - Save the task. Repeat steps 4–7 with the dark script triggering at
19:00.
Both tasks fire silently in the background — no console window appears. The script takes a few milliseconds; the UI repaints within a second.
Method 2: Tie the switch to local sunrise/sunset instead of fixed times
Fixed times drift relative to real daylight across the year. If you’d rather have the dark mode flip at actual sunset, calculate it inside the same PowerShell script using the free sunrise-sunset.org API.
- Replace your light/dark scripts with one combined script that pulls today’s sunset and decides which mode to set:
$lat = 35.6895; $lon = 139.6917 # your coordinates
$r = Invoke-RestMethod “https://api.sunrise-sunset.org/json?lat=$lat&lng=$lon&formatted=0”
$sunset = [datetime]$r.results.sunset
$mode = if ((Get-Date) -gt $sunset) { 0 } else { 1 }
$path = “HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize”
Set-ItemProperty -Path $path -Name AppsUseLightTheme -Value $mode
Set-ItemProperty -Path $path -Name SystemUsesLightTheme -Value $mode - Save as
theme-auto.ps1and update one of your Task Scheduler tasks to run this script at 06:00 and 17:00 (or whatever bracket covers your latitude across all seasons). - Optionally schedule a third run at logon (Triggers → At log on) so the right mode is set when you wake the PC up mid-day.
The API has no auth, no rate limit at this volume, and returns UTC times. PowerShell’s [datetime] cast converts to your local time automatically.
Method 3: Apps-only switch when the taskbar should always stay dark
Some users want File Explorer and Settings to follow the time of day but want the taskbar permanently dark so it doesn’t glow at night. Drop SystemUsesLightTheme from your scripts entirely.
- Edit both
theme-light.ps1andtheme-dark.ps1(or the auto script) and remove the line that setsSystemUsesLightTheme. - Open Settings → Personalization → Colors and set the Windows mode to Dark manually one last time.
- Run your task. Apps flip; taskbar stays dark.
This is the configuration most night owls end up at. The taskbar is visible against bright app windows all day either way, and a dark taskbar against a light Settings page is less jarring than the reverse.
How to verify the fix worked
- Open Task Scheduler, find your task, right-click and choose Run. The theme should flip within a second.
- Check Last Run Result in the task list — it should read (0x0) for success.
- Wait until your scheduled time and confirm the switch happens unattended.
If none of these work
If the registry values change (verify with reg query “HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize”) but the UI doesn’t repaint, restart Explorer with taskkill /f /im explorer.exe && start explorer.exe at the end of your script. If Task Scheduler runs the script but the values stay the same, your PowerShell execution policy is blocking the script — open PowerShell as the same user as the task and run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned. For users who don’t want to maintain a script, Auto Dark Mode (open source, on GitHub) handles all of this in a GUI; it’s the only third-party tool worth recommending for this niche.
Bottom line: Two registry DWORDs plus Task Scheduler give you the theme schedule Windows 11 should have shipped with. The Method 2 sunrise/sunset variant takes ten minutes longer but is the version you set once and never touch again.