I would like to write an AHK script to be able to switch between portrait and landscape mode by a single key. Here is my first attempt not exactly what I am looking for. I am not an expert in the AHK scraping language. The script works but it shows the CMD windows for a few seconds while running the display.exe command. How to prevent opening CMD window.
F14::
T := !T
If T
Run display /rotate 0 /device 3 /display none,,Hide
else
Run display /rotate 90 /device 3 /display none,,Hide
return