Automatically enable Dark Theme in Settings app on Windows 10

If you are using Windows 10, you will find a Light and Dark theme for Settings app in Colors section under Personalization settings. By default, it uses Light theme as this is more user-friendly. But, some people do not want to get eye strain and hence, they use the Dark Theme at night. This tutorial will let you enable dark theme automatically on Windows 10.

Automatically enable Dark Theme on Windows 10

While you can always manually enable the Dark Theme via the Settings app, you can also use the Windows Task Scheduler to create a task that automatically enables and disable the dark Theme according to your parameters.

To do so, you will have to use PowerShell and Task Scheduler. You need to create two PowerShell scripts and use them with Task Scheduler so that they can run as per your predefined time.

Open Notepad and save the following two lines of code separately with .ps1 extension.

To enable Dark Mode:

New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 -Type Dword -Force

To re-enable Light Mode:

Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme

After creating two separate .ps1 files, open Task Scheduler. Search for Task Scheduler in the Taskbar search box. Here, you have to create two different tasks. One task will be performed to enable the Dark theme, and another task will be conducted to re-enable the Light theme.

Here, you have to create two different tasks. One task will be performed to enable the Dark theme, and another task will be conducted to re-enable the Light theme.

After opening Task Scheduler, click on Create Basic Task to schedule a Basic Task. This should be visible on the right-hand side.

Automatically enable Dark Theme on Windows 10

Enter a name of this task. Select Daily in the Trigger, and set date and time when you want to start and keep using the script. You need to select a time when you want to perform the task. After that, choose,

After that, choose, Start a program in the Action section. On the next page, enter the following line in the Program/script path area;

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "dark-theme—script-file-path"

Automatically enable dark theme in Settings app on Windows 10.

Complete the wizard to its conclusion.

Now, in the same way, you have to create another task to activate the Light Theme.

One setback of this trick is it doesn’t work when your computer is shut down. For instance, let’s assume that you have selected 6 PM for enabling the Dark mode. If your computer is not turned on at 6 PM, this script won’t work or the task cannot be performed and the Dark theme won’t be enabled.

If you like dark themes, you might want to take a look at these posts too:

  1. Enable Dark Theme in Edge browser
  2. Enable Dark theme on new Edge Chromium browser
  3. Switch to Dark Gray theme in Office
  4. Enable Dark Mode in Movies & TV App
  5. Enable Dark theme for Twitter App.
Posted by on , in Category Windows with Tags
Sudip is a student who loves to engage with the latest technology & gadgets. Apart from writing about all things technology, he is a Photoshop junkie and a football enthusiast.

One Comment

  1. postanote

    ### Begin: A small rant though ###

    First, why do folks keep suggesting using Notepad and o tthe non-powershell
    capable editors to write powershell scripts, when the built-in PowerShell_ISE
    Is a far better and more intelligent tool for this kind of this.

    You , write, test, debug in a single tool. You cannot do this in non PowerShell
    capable editors of course, so why go there at all.

    If one does not lkike the PowerShell _ISE, for whatever reason, then
    VisualStudioCode, should be the next time of choice.

    Both avoids all the seperate tool and copy and paste from notepad or whatever
    back into PowerShell craziness.

    Then of course there are teh paidf for enterprise PowerShell IDE, like Sapien’s
    PowerShell Studio and others free ones like Idera’s PowerShellPlus, or even
    Visual Studio Community edition with PowerShell add-ons. Yet these might be
    overkill for many IT pros.

    Drop the Notepad stuff, and user VSCode (super notepad for PowerShell and more).
    Or just use the built-In PowerShell_ISE.

    ### End: A small rant ###

    Example – perfroming all build, edit, test, validate all in Visual Studio Code
    YOu have an intelligent editor to help you along the way with full INtelliSense,
    debug and test it live before you set you Task Schedule.

    Last point, once tested you can create that task schedule item using PowerShell directly

    $StartTime = Get-Date ’18:00:00′
    $Endtime = Get-Date ’08:00:00′
    $CurrentTime = Get-Date

    If ($StartTime.TimeOfDay -le $CurrentTime.TimeOfDay `
    -and $Endtime.TimeOfDay -ge $CurrentTime.TimeOfDay)
    # ‘Enableing Dark Theme’

    New-ItemProperty `
    -Path HKCU:SOFTWAREMicrosoftWindowsCurrentVersionThemesPersonalize `
    -Name AppsUseLightTheme `
    -Value 0 `
    -Type Dword -Force
    # ‘Enabling Light Theme’

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

    Now, with this one script all you need is the task schedule, set to start daily
    at 1800hrs (6:00 pm)

    # Create a scheuld task
    $action = New-ScheduledTaskAction -Execute ‘Powershell.exe’ -Argument ‘D:ScriptspowershelltipsSet-WindowsTheme.ps1’
    $trigger = New-ScheduledTaskTrigger -Daily -At 6pm
    Register-ScheduledTask -Action $action -Trigger $trigger `
    -TaskName ‘Set-WindowsTheme’ -Description ‘Set the Windows desktop theme to dark or light based on time of day’ `
    -User “System”

    # Validate task creation
    Get-ScheduledTask -TaskName ‘Set-WindowsTheme’

    # Test the task – If between 6pm and 8am, the theme will be set to dark.
    Start-Process -FilePath schtasks ‘/run /I /TN “Set-WindowsTheme”‘

Leave a Reply

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

4 + 4 =