Toggle Dark/Light Mode in Windows 11 automatically by time of day (without modifying or changing theme!)

26 Views Asked by At

This question follows this question: link

And this answers by Sebastián Vansteenkiste: link

From his solution, I had to change the argument of my action.

From this: -file C:\yourscript.ps1

To this: -ExecutionPolicy Bypass -file C:\yourscript.ps1

Otherwise, I had this error:

Unable to load file E:\Other\AutomaticallyChangeWindowsTheme.ps1 because script execution is
disabled on this system. For more information, see about_Execution_Policies at
https://go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess

But now, when my theme is switched by the task or if I execute the script myself, in the settings my application mode correctly switches:

Screenshot of choose your mod seeting of windows 11

(From Light (Clair) in Dark (Sombre))

But my file explorer is bugged and don't change: Screenshot of the file explorer that haven't change completly of theme

Even if I close and open the file explorer it's still bugged: Screenshot of the file explorer that haven't change completly of theme

Is there a command to add to the script to achieve the exact same effect as switching the application mode from my settings?

Thank you in advance for the help!

0

There are 0 best solutions below