The HDR button inside windows 10 display settings does not have an API associated with it and clicking it using autoit3 is not very reliable.
Nvidia to the rescue.
Nvidia has the nvapi which exposes a way to to turn HDR on/off. I dont think AMD has anything similar

I have a code example in C# if interested that does exactly this using nvapi.
Also madVR automatically toggles the HDR mode (using nvapi) based on meta data of the video file rendered.
http://madvr.com/
My usecase would be the native netflix windows app, which does NOT support auto toggling HDR mode. One have to do this manually.. sigh.
I could hook up my remote control to trigger this functionality within E.G.
regards
gibman