Sometimes you need to quickly decrease or increase screen brightness without extra clicks. On my laptop this used to be handled by the built-in ASUS utility, but it always messed with the fan control, so I had to remove it. In the end, you can just use this script.
- Download AutoHotKey
- Create a
.ahkfile and put this inside:
F1:: Run, cmd /c wmic /namespace:\\root\wmi PATH WmiMonitorBrightnessMethods WHERE "Active=1" CALL WmiSetBrightness Brightness=10 Timeout=1 return F2:: Run, cmd /c wmic /namespace:\\root\wmi PATH WmiMonitorBrightnessMethods WHERE "Active=1" CALL WmiSetBrightness Brightness=100 Timeout=1 return
It didn’t work through PowerShell, so I used the internal Windows way.
What the script does:
- Runs Windows Command Prompt (
cmd /c) and executes thewmicutility. wmicaccesses the WMI namespaceroot\wmi, selecting theWmiMonitorBrightnessMethodsclass (responsible for monitor brightness control methods).- The filter
WHERE "Active=1"means it applies only to the active monitor. CALL WmiSetBrightness Brightness=10 Timeout=1— calls theWmiSetBrightnessmethod to set brightness to n%. TheTimeout=1parameter specifies the delay in seconds.
Now the F1 key lowers brightness to 10%, and F2 raises it to 100%. You can adapt the script to any values and hotkeys. Enjoy! 😀