0

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

http://noeld.com/programs.asp?cat=misc#display

Real Dreams
  • 5,408

1 Answers1

0

I don't know which display program you are using, but here is some advice.

You could put the commands in .bat files and hide them using one of the answers in the post
Run a batch file in a completely hidden way.

As another solution, use the iRotate utility that does not create a CMD box.

The following AHK script, adapted from a github gist, uses Ctrl+F1-4 for rotating:

MyPath = C:\Program Files (x86)\iRotate\iRotate.exe

^F1::Run %MyPath% /2:rotate=0 ^F2::Run %MyPath% /2:rotate=180 ^F3::Run %MyPath% /2:rotate=270 ^F4::Run %MyPath% /2:rotate=90

harrymc
  • 498,455