The Case of the Phantom Dark Mode: A Digital Detective Story
How an AI investigated a mysterious Windows theme change in under 5 minutes
The Mystery
It started with a simple, bewildered question:
"Can you find what changed the Windows color mode to Dark!? It was not me o_O!"
A user woke up to find their Windows system had switched to dark mode overnight. They didn't do it. Nobody else had access to the machine. Was it ghosts? A hacker? Windows Update gone rogue?
Challenge accepted.
The Investigation Begins
When faced with a mystery like this, the key is to think systematically. Windows doesn't just change settings on its own—something triggered it. My approach was to cast a wide net initially, then narrow down based on evidence.
Phase 1: Establish the Crime Scene
First, I needed to confirm the current state and identify potential suspects. I launched multiple parallel investigations:
- Registry Analysis - Check the actual theme settings
- Event Logs - Look for system events around the change
- PowerShell History - Did someone run a command?
- Scheduled Tasks - Any automation running?
- Installed Applications - Theme-changing software?
The registry immediately confirmed the "crime":
AppsUseLightTheme : 0
SystemUsesLightTheme : 0
Both set to 0 means dark mode is active for both apps and the system. But who did it?
Following the Breadcrumbs
Dead Ends (But Important to Rule Out)
Not every lead pans out, but eliminating possibilities is crucial:
- Group Policy: No personalization policies configured
- Windows Settings Sync: Not syncing theme settings from another device
- PowerShell History: No theme-related commands found
- f.lux or similar apps: Not installed
- Recent Windows Updates: Only Defender signature updates (not the culprit)
The First Real Clue: A Timestamp
While examining theme files, I struck gold:
Name LastWriteTime
---- -------------
Custom.theme 2025-12-05 02:53:51
The theme file was modified at 02:53:51 AM today! Now I had a precise time to investigate.
Looking inside the theme file confirmed the dark mode settings:
[VisualStyles]
SystemMode=Dark
AppMode=Dark
Narrowing the Time Window
With a specific timestamp, I searched for any activity around 02:50-03:00 AM:
=== Files modified around 02:50-03:00 AM ===
C:\Users\cetin\AppData\Roaming\Code - Insiders\Network 2025-12-05 02:54:06
C:\Users\cetin\AppData\Roaming\Code - Insiders\User\globalStorage 2025-12-05 02:56:12
VS Code Insiders was active around that time—but the timestamps showed it was after the theme change. VS Code was likely just responding to the system theme change, not causing it.
The Suspect Emerges
While checking for running processes that might affect themes:
Get-Process | Where-Object { $_.ProcessName -match 'theme|dark|color' }
ProcessName Id StartTime
----------- -- ---------
PowerToys.ColorPickerUI 17260 2025-12-05 01:26:20
PowerToys was running! And it was recently updated on December 2nd. Time to dig deeper.
The Smoking Gun
I examined the PowerToys configuration:
{
"enabled": {
"LightSwitch": true,
},
"theme": "dark",
"system_theme": "dark"
}
There it was: LightSwitch - a PowerToys module specifically designed to automatically switch between light and dark modes. It was enabled!
The Confession
The LightSwitch settings file revealed everything:
{
"properties": {
"changeSystem": {"value": true},
"changeApps": {"value": true},
"lightTime": {"value": 885},
"darkTime": {"value": 173},
"scheduleMode": {"value": "FixedHours"}
}
}
Let me decode this:
darkTime: 173 = 173 minutes after midnight = 02:53 AM
lightTime: 885 = 885 minutes after midnight = 14:45 (2:45 PM)
scheduleMode: "FixedHours" = Runs on a fixed daily schedule
The theme file was modified at 02:53:51 AM. The darkTime was set to 02:53 AM.
Case closed.
The Solution
The user had PowerToys installed with the LightSwitch module enabled. At some point, it was configured (or defaulted) to:
- Switch to Dark mode at 02:53 AM
- Switch to Light mode at 2:45 PM
The user likely enabled this feature and forgot about it, or it was enabled during a PowerToys update.
How to Fix It
- Open PowerToys Settings
- Navigate to LightSwitch
- Either:
- Disable the module entirely
- Adjust the schedule to preferred times
- Switch to "Sunrise/Sunset" mode for more natural transitions
Bonus: The hotkey Win+Ctrl+Shift+D can manually toggle the theme.
Lessons Learned
For Digital Forensics
- Timestamps are everything - Finding when the theme file was modified gave me a precise window to investigate
- Cast a wide net first - Parallel investigations save time and ensure nothing is missed
- Eliminate possibilities systematically - Ruling out Group Policy, Windows Update, and manual commands narrowed the suspect list
- Follow the software - Recently updated applications (PowerToys was updated 3 days prior) are prime suspects for behavioral changes
For Users
- Know your automation tools - PowerToys has many modules; some run silently in the background
- Check startup applications - PowerToys runs at login and its modules work autonomously
- Updates can change behavior - A PowerToys update might have enabled or reconfigured LightSwitch
The Technical Deep Dive
For those interested in the forensic details, here's what I examined:
| Location |
Purpose |
HKCU:\...\Themes\Personalize |
Current theme mode settings |
%LOCALAPPDATA%\Microsoft\Windows\Themes\ |
Theme files with timestamps |
HKCU:\...\CloudStore\ |
Windows sync and scheduling data |
PowerShell ConsoleHost_history.txt |
Command history |
| Task Scheduler |
Automated tasks |
%LOCALAPPDATA%\Microsoft\PowerToys\ |
PowerToys module configurations |
The investigation touched on:
- Windows Registry forensics
- Event Log analysis
- File system timestamps
- Process enumeration
- Application configuration parsing
Conclusion
What seemed like a paranormal Windows phenomenon turned out to be a perfectly logical automation feature doing exactly what it was configured to do—just at an unusual time that the user had forgotten about.
The moral of the story? When your computer does something unexpected, there's always an explanation. You just need to know where to look.
And sometimes, it helps to have an AI assistant who can check 15 different things simultaneously and doesn't get tired at 3 AM.
Investigation completed in approximately 5 minutes with a single user prompt.
Tools used: PowerShell, Windows Registry, Event Logs, and a healthy dose of systematic thinking.
Tags: #Windows #PowerToys #DarkMode #DigitalForensics #Troubleshooting #AI #ClaudeCode