How to switch to the dark mode automatically on Windows 10

Windows 10 comes with two personalization modes ― the light mode, which is the bright default mode on every installation, and it works very well during daytime; and the dark mode that tints parts of the OS and supported apps with a dark color scheme, and it's more suitable for low-light conditions, such as when working late at night.

Although you can quickly change modes using the Settings app, unlike Night light, Windows 10 doesn't include an option to use the light mode during the day and automatically switch to the dark mode at night. However, it's still possible to create an automated process using a couple of PowerShell commands and Task Scheduler to automatically switch to the dark mode at a particular time of your choosing.

In this Windows 10 guide, we'll walk you through the steps to configure your computer to switch to the dark mode automatically using PowerShell and Task Scheduler.

How to switch between light and dark mode on Windows 10

In order to switch back and forth between light and dark mode automatically on Windows 10, you'll need to schedule two tasks, each one running a different PowerShell command that will change the Registry setting that controls the personalization modes.

Warning: This is a friendly reminder that editing the registry is risky, and it can cause irreversible damage to your installation if you don't do it correctly. It's recommended to make a full backup of your PC before proceeding.

Creating task to switch to the dark mode

The first thing you need to do is to set up and schedule a task to enable the dark mode at a specific time at night, which you can do with the following steps:

  1. Open Start.
  2. Search for Task Scheduler and click the result.
  3. Expand the Task Scheduler Library folder.
  4. Right-click Task Scheduler Library and select New Folder.

  1. Enter a name for the folder (e.g., MySchedules), and click OK.Quick Note: We're creating a new folder to keep yours and system tasks separate, which makes it easier to manage tasks.
  2. Right-click the newly created folder and select Create Task.

  1. On the "General" tab, under "Name," enter a descriptive name for the task (e.g., switch_dark_mode).
  2. Under "Security options," select the option Run whether user is logged on or not option.
  3. Check the Do not store password option.

  1. Click on the Triggers tab.
  2. Click the New button.
  3. Under "Begin the task," select On a schedule, but you can configure any trigger you want.
  4. Under "Settings," select the Daily option.
  5. Set the time (e.g., 6:30 PM) you want Windows 10 to switch automatically to the dark mode.
  6. Click OK.

  1. Click on the Actions tab.
  2. Click the New button.
  3. Using the "Start a program" action, under "Settings," copy and paste the following path:%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
  4. Under "Add arguments (optional)," copy and paste the following PowerShell command:New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 -Type Dword -ForceThe above command will try to create a AppsUseLightTheme DWORD in the Registry and set its value to 0, which disables the light mode and enables the dark mode.
  5. Click OK.

  1. Click on the Settings tab.
  2. Check the Run task as soon as possible after a scheduled start is missed option, which should help to run the command if Task Scheduler misses the schedule because your computer was asleep. (Just remember that according to Microsoft's documentation, using this option, Task Scheduler can take up to ten minutes or so to run missed tasks.)
  3. Check the If the task fails, restart every option, and make sure it's set to 1 minute and only 3 restart attempts.
  4. Click OK.

Once you've completed the steps, every day at the time you specified, Windows 10 will switch to the dark theme automatically.

Creating task to switch to the light mode

The last thing left to do now is to create another task to change from the dark to the light theme, which you can do with the following steps:

  1. Right-click the folder created to store your tasks and select Create Task.

  1. On the "General" tab, under "Name," enter a descriptive name for the task (e.g., switch_light_mode).
  2. Under "Security options," select the option Run whether user is logged on or not option.
  3. Check the Do not store password option.

  1. Click on the Triggers tab.
  2. Click the New button.
  3. Under "Begin the task," select On a schedule, but you can configure any trigger you want.
  4. Under "Settings," select the Daily option.
  5. Set the time (e.g., 6:30 AM) you want Windows 10 to switch automatically to the light mode.
  6. Click OK.

  1. Click on the Actions tab.
  2. Click the New button.
  3. Using the "Start a program" action, under "Settings," copy and paste the following path:%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
  4. Under "Add arguments (optional)," copy and paste the following PowerShell command:Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 1The above command will update the AppsUseLightTheme DWORD in the Registry with the value of 1, which enables the light mode and disables the dark mode.
  5. Click OK.

  1. Click on the Settings tab.
  2. Check the Run task as soon as possible after a scheduled start is missed option, which should help to run the command if Task Scheduler misses the schedule because your computer was asleep. (Just remember that according to Microsoft's documentation, using this option, Task Scheduler can take up to ten minutes or so to run missed tasks.)
  3. Check the If the task fails, restart every option, and make sure it's set to 1 minute and only 3 restart attempts.
  4. Click OK.

After creating both tasks, Windows 10 will automatically switch between light and dark theme on the schedule you specified without having to restart your computer for the changes to take effect.

If you no longer want to use this feature, you can simply go to the Task Scheduler folder you created, right-click, and delete each task. Then you can continue to use the Settings app to switch modes from the Personalization section.

More Windows 10 resources

For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:

Mauro Huculak

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.