Automatically Switch To The Dark Theme At Night In Windows 10

Windows 10 has a dark and light theme. It applies to all UWP apps. Users can switch to the dark or light theme from the Settings app. What they can’t do is schedule when Windows 10 will automatically switch to a dark or light theme. The Creators Update expected to arrive this month has a Night Light feature that will tint your screen a warm color. You can schedule Night Light but it isn’t the same as switching to the dark theme at night. Here’s how you can automatically switch to the dark theme at night in Windows 10 using a little script and a scheduled task.

You don’t need administrative rights to switch to the dark theme at night. This is something a standard user can do. We’re going to be doing it via a script. You will need to create two scripts; one to switch to the dark theme at night, and one to switch back to the light theme when it’s day.

Script For Dark Theme

Open Notepad and paste the following. Save it as a PS1 file with a suitable name like Dark Theme.

New-ItemProperty -Path HKCU:SOFTWAREMicrosoftWindowsCurrentVersionThemesPersonalize -Name AppsUseLightTheme -Value 0 -Type Dword -Force

Script For Light Theme

Open Notepad and paste the following. Save this file as a PS1 file named Light Theme, or something similar.

Remove-ItemProperty -Path HKCU:SOFTWAREMicrosoftWindowsCurrentVersionThemesPersonalize -Name AppsUseLightTheme

Create Scheduled Tasks

We’re now going to create two scheduled tasks. The first task will run the Dark Theme script you just created. The second task will run the Light Theme script. We will use the built-in Task Scheduler app to create and run these tasks. You do not need administrative rights to create and run tasks.

Open Task Scheduler; type Task Scheduler in the Windows search bar and select the app from the search results.

On the Actions pane, select ‘Create Basic Task’. This will open the task wizard.  Enter a name for the task and give it a description. The description is optional but it’s a good idea to add one so you know what the script does. Click ‘Next’.

On the ‘Task Trigger’ screen, select the ‘Daily’ option and click ‘Next again.

To switch to the dark theme at night, set the time to sunset or whenever you think ‘night’ officially starts. Set it to a time when your system will be running e.g., 6PM.

To switch back to the light theme in the morning, enter whenever you consider it to be morning. Set it to a time when you know your system will be active e.g. 8AM and not 4AM when the system is likely to be asleep or Off.

On the ‘Actions’ screen, select ‘Start a program’ and click Next. This is where things will be slightly different for the dark and light scripts you want to run.

For the dark theme, enter the following in the browse field;

%SystemRoot%system32WindowsPowerShellv1.0powershell.exe -ExecutionPolicy Bypass -File "C:path-to-scriptname-of-Dark-theme-script.ps1"

For the light theme, enter the following in the browse field;

%SystemRoot%system32WindowsPowerShellv1.0powershell.exe -ExecutionPolicy Bypass -File "C:path-to-scriptname-of-Light-theme-script.ps1"

You will see an alert confirming the parameters you’ve set. Click ‘Yes’ on the alert and you’re all done.

A Caveat

The tasks cannot run if your system is asleep or hibernating. If you set the task to run at a time when your system is likely to be in an off state, this won’t work for you. You will have to manually run the scripts. This is why you have to be careful when you set the time for the task to be run. Set it to a time you know your system will be running.

This little trick is the brainchild of Reddit user exile09.

قالب وردپرس

About Kelli Smith

Kelli Smith
Kelli runs customer support and creates content for Skillcrush, a digital skills training and education platform with friendly instructors, an active student community, and laser focus on helping you achieve your career goals with technology. She has an MBA and successfully ran an international company and her own freelancing business before pursuing her passion for tech by taking advanced web development classes. Kelli loves listening to tech podcasts at 2x speed, looking for cute Corgi photos online and teaching and performing country line dancing—as a true Texan living in Finland would do. Say hi on Twitter.

Leave a Reply

Your email address will not be published. Required fields are marked *