如何在Windows 10中通过命令开启夜灯、启用即时夜灯及设置色温?
Hey folks, here's how to handle both Night Light command-line tasks in Windows 10:
If you just want to turn on Night Light using your existing scheduled settings, you can modify the relevant registry entry via Command Prompt or PowerShell. Here's the Command Prompt command:
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$windows.data.bluelightreduction.bluelightreductionstate\Current /v Data /t REG_BINARY /d 01000000010000000000000000000000 /f
This sets Night Light to enabled. To turn it off later, replace the binary value with 01000000000000000000000000000000.
If you prefer PowerShell, use this:
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$windows.data.bluelightreduction.bluelightreductionstate\Current" -Name Data -Value ([byte[]](0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)) -Type Binary
To make the change take effect immediately, restart File Explorer:
taskkill /f /im explorer.exe && start explorer.exe
To activate Night Light instantly (bypassing scheduled times) and set a custom color temperature, you'll modify a specific registry entry that controls the advanced Night Light settings.
Step 1: Enable instant Night Light
Run this Command Prompt command to turn on instant mode (this ignores your scheduled on/off times and keeps Night Light active right away):
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$windows.data.bluelightreduction.settings\Current /v Data /t REG_BINARY /d 010000000100000000000000000100000064000000 /f
Step 2: Adjust color temperature
The last 4 bytes in the binary value (64000000 in the command above) control the temperature. This is a little-endian 32-bit integer:
00000000= 6500K (default, coolest)64000000= 2200K (warmest)
To set a custom temperature:
- Calculate the value using:
Value = ((6500 - Target_Kelvin) / (6500 - 2200)) * 100 - Round to the nearest integer, then convert it to a little-endian 4-byte hex string.
For example, to set 4000K:
- Calculation:
((6500 - 4000)/4300)*100 ≈ 58 - Little-endian hex for 58:
3A000000 - Updated command:
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$windows.data.bluelightreduction.settings\Current /v Data /t REG_BINARY /d 01000000010000000000000000010000003A000000 /f
Step 3: Apply changes
Restart File Explorer to see the changes immediately:
taskkill /f /im explorer.exe && start explorer.exe
内容的提问来源于stack exchange,提问作者elig




