How to toggle HDR with a script on Windows 10
Windows 10 supports HDR. If you have the hardware to support it, you can enable it from the Settings app. The option is a bit buried though so it wouldn’t come as a surprise if the common user doesn’t know it even exists. If you do have the hardware to watch HDR content, you might want a quicker way to enable it. There’s no Quick Action for it in the Action Center which is why a script is the way to go.
Toggle HDR script
In order to toggle HDR, we’re going to need two scripts; one to enable it and one to disable it. These scripts have been written by Reddit user u/tannerjohngates.
Enable HDR script
Open a new Notepad file and paste the following in it;
Set oShell = CreateObject("WScript.Shell") oShell.Run("""ms-settings:display""") WScript.Sleep 2000 oShell.AppActivate "settings" WScript.Sleep 100 oShell.SendKeys "{TAB}" WScript.Sleep 60 oShell.SendKeys "{TAB}" WScript.Sleep 60 oShell.SendKeys "{TAB}" WScript.Sleep 60 oShell.SendKeys " " WScript.Sleep 3000 oShell.SendKeys "{TAB}" WScript.Sleep 50 oShell.SendKeys " " WScript.Sleep 50 oShell.SendKeys "%{F4}"
Save this script with the .VBS file extension and give it a name that tells you it will enable HDR.
Disable HDR script
Open a new Notepad file and paste the following in it. Again, save it with the .VBS file extension and give it a name that tells you it will disable HDR.
Set oShell = CreateObject("WScript.Shell") oShell.Run("""ms-settings:display""") WScript.Sleep 2000 oShell.AppActivate "settings" WScript.Sleep 100 oShell.SendKeys "{TAB}" WScript.Sleep 60 oShell.SendKeys "{TAB}" WScript.Sleep 60 oShell.SendKeys " " WScript.Sleep 3000 oShell.SendKeys "{TAB}" WScript.Sleep 50 oShell.SendKeys " " WScript.Sleep 50 oShell.SendKeys "%{F4}"
When you run these scripts, they will open the Settings app, automatically select the System group of settings, go to the Display tab, select the HDR option on the Display tab, and then enable it.
The script isn’t going to run in the background, nor is it going to tweak anything in the registry. It is still going through the Settings app so you don’t have to worry about it changing something that you can’t change on your own.
Since this is a script, it might run into some trouble if you have multiple displays and only one of them supports HDR. The script cannot select a different display and when the Setting app is opened, your primary display is the one that is selected by default. If it doesn’t support HDR, this script won’t be of much use to you.
The simple work around to this is to set the display that supports HDR as your primary display. Microsoft has, surprisingly, neglected to add a toggle for this in the Action center even though it would be pretty useful.
Nette Idee – hier ein Update für Windows 11 und schnellere Rechner:
oShell.Run(“””ms-settings:display”””)
WScript.Sleep 400
oShell.AppActivate “settings”
WScript.Sleep 80
oShell.SendKeys “{TAB}”
WScript.Sleep 40
oShell.SendKeys “{TAB}”
WScript.Sleep 40
oShell.SendKeys “{TAB}”
WScript.Sleep 40
oShell.SendKeys “{TAB}”
WScript.Sleep 40
oShell.SendKeys “{TAB}”
WScript.Sleep 40
oShell.SendKeys “{TAB}”
WScript.Sleep 40
oShell.SendKeys ” ”
WScript.Sleep 80
oShell.SendKeys “%{F4}”
Can we get an update? This opens up my resolutions settings now. Maybe some windows setting has changed since it was first written?
My script for W10 pro v1909
Set oShell = CreateObject(“WScript.Shell”)
oShell.Run(“””ms-settings:display”””)
WScript.Sleep 200
oShell.AppActivate “settings”
WScript.Sleep 50
oShell.SendKeys “{TAB}”
WScript.Sleep 50
oShell.SendKeys “{TAB}”
WScript.Sleep 50
oShell.SendKeys ” ”
WScript.Sleep 50
oShell.SendKeys “%{F4}”
The first script changes the scale to 150% not enable HDR. What’s the correct script to enable HDR?
Pretty cool, but I had to remove one instance of the “oShell.SendKeys “{TAB}”
WScript.Sleep 60″ lines
They is a error on the first script is :
Set oShell = CreateObject(“WScript.Shell”)
oShell.Run(“””ms-settings:display”””)
WScript.Sleep 2000
oShell.AppActivate “settings”
WScript.Sleep 100
oShell.SendKeys “{TAB}”
WScript.Sleep 60
oShell.SendKeys “{TAB}”
WScript.Sleep 60
oShell.SendKeys ” ”
WScript.Sleep 3000
oShell.SendKeys “{TAB}”
WScript.Sleep 50
oShell.SendKeys ” ”
WScript.Sleep 50
oShell.SendKeys “{TAB}”
WScript.Sleep 50
oShell.SendKeys ” ”
WScript.Sleep 50
oShell.SendKeys “%{F4}”
its not pretty but if you have multiple monitors you can keep putting in more tabs until it loops around, then select your display and tab down to the HDR toggle.