Skip to content

Windows theme switch script

Updated: at 20:24

This guide will help you set up two scripts to switch themes on Windows: one to activate the light theme at 7 AM and another to activate the dark theme at 9 PM.

Windows theme switch script

Table of contents

Open Table of contents

Step 1: Create PowerShell Scripts

Create two PowerShell script files: Set-LightTheme.ps1 and Set-DarkTheme.ps1.

1.1 Set-LightTheme.ps1

# Set-LightTheme.ps1
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 1 -Type Dword -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 1 -Type Dword -Force

1.2 Set-DarkTheme.ps1

# Set-DarkTheme.ps1
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 -Type Dword -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 0 -Type Dword -Force

Step 2: Schedule the Scripts with Task Scheduler

2.1 Open Task Scheduler

  1. Press Win + S and type “Task Scheduler”.
  2. Click on Task Scheduler to open it.

2.2 Create a New Task

  1. In the Actions panel, click on Create Basic Task.

2.3 Name the Task

  1. Name: “Set Light Theme”
  2. Description: “Activates Light Desktop Theme At A Certain Time”

2.4 Set the Trigger

  1. Select Daily and click Next.
  2. Set the start time to 7:00 AM and click Next.

2.5 Start a Program

  1. Select Start a program and click Next.

2.6 Program/Script

  1. Program/script: powershell.exe
  2. Add arguments (optional): -ExecutionPolicy Bypass -File "C:\Path\To\Set-LightTheme.ps1"
  3. Apply the following parameters in Settingstab: Parameters settings
![Parameters settings](path/to/parameters-settings.png)

2.7 Click Finish to create the task

2.8 Repeat for Dark Theme

Repeat the above steps to create a task for the dark theme, but with the following changes:

  1. Name: “Set Dark Theme”
  2. Description: “Activates dark theme at 9 PM.”
  3. Start time: 9:00 PM
  4. Add arguments (optional): “-ExecutionPolicy Bypass -File “C:\Path\To\Set-DarkTheme.ps1”`

Step 3: Verify the Tasks

  1. Go to the Task Scheduler Library.
  2. Verify that both tasks (Set Light Theme and Set Dark Theme) are listed and scheduled correctly.

Notes