This repository contains a PowerShell script that allows users to switch between dark mode and light mode on a Windows 10/11 computer. Unlike other scripts available on the internet, this script ensures a proper switch between modes.
A PowerShell script to switch between light and dark mode in Windows.
This script allows the user to switch between light and dark mode in Windows by setting the DarkMode parameter to 0 or 1 respectively.
An integer parameter that controls the dark mode setting. The default value is -1. Set to 0 to enable light mode and 1 to enable dark mode.
.\win11darklightmode.ps1 -DarkMode 0
.\win11darklightmode.ps1 -DarkMode 1
.\win11darklightmode.ps1
The script automatically checks if Windows 11 is currently in Dark Mode and switches to Light Mode accordingly. It also verifies if Windows 11 is in Dark Mode and then switches to Light Mode.
You can automatically switch modes based on time of day by utilizing the config-taskscheduler.ps1 script.
This script creates or removes two scheduled tasks that switch between light and dark mode on Windows 11 at specified times.
This script is used to create two scheduled tasks that switch between light and dark mode on Windows 11 at specified times.
The script requires administrative priviledge, therefore, it checks if it is being run as an administrator and exits if it is not.
The script takes three parameters: LightModeTime
, DarkModeTime
, and Remove
.
If the LightModeTime
and DarkModeTime
parameters are not specified, the script will prompt the user to enter them.
The script then creates two scheduled tasks using the specified times, one for switching to light mode and one for switching to dark mode.
If the Remove
parameter is specified, the script will remove the scheduled tasks.
The time at which the light mode task should be triggered (e.g. "8am").
The time at which the dark mode task should be triggered (e.g. "6pm").
If specified, the script will remove the scheduled tasks.
.\config-taskscheduler.ps1 -LightModeTime "8am" -DarkModeTime "6pm"
Creates two scheduled tasks that switch between light and dark mode on Windows 11 at 8am and 6pm respectively.
.\config-taskscheduler.ps1 -Remove
Removes the two scheduled tasks created by this script.
These scripts are compatible with Windows 10 and Windows 11.
Please note that these scripts require administrator privileges to run.