6

I found one StackOverflow discussion about it, but there was no answer.

And apparently, they don't consider it a "programming-based" question (which is why I am asking here.)

Anyways, I made a Batch file, that detects whether or not you use Windows 10 - Now I just need to know how you activate (And deactivate) Night Light with Batch [Or if it's possible in the first place] - The button that lies behind the Display Settings.

I marked "Something to activate it" because I need something to activate it (Like I said). Anything that could relate to the control desk.cpl command, or just something completely different, would help. - As long as it directly activates/deactivates the Night Light function.

:nightlight
for /f "tokens=2 delims=," %%i in ('wmic os get caption^,version /format:csv') do set os=%%i
echo %os%|find " 10 ">nul &&goto win10||goto other
:win10
color 0a
echo Windows 10 Activating Night Light
*SOMETHING TO ACTIVATE IT* > nul
goto A

Thanks in advance.

1 Answers1

2

Configure Windows Creators Update Night Light via Registry

Relevant part:
The format 4 constant bytes - seemingly a signature common to all CloudStore values
The last-modified time of the setting as a 64-bit FILETIME value (8 bytes, little endian)
8 more constant bytes
The bytes 2 then 1 if the blue light reduction feature is enabled, just gone if it's disabled

Im awful at script but just use the but you only need to change the data in
HKCU\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$$windows.data.bluelightreduction.settings\Current
to with a 02 01 or without and it changes the setting on or off. the pain in the rear part it that to truly toggle it you have to decode that data array, check if is enable or is disable and set the value accordingly. good luck with that.

Null
  • 21