Windows Powershell / .NET script
Instantly flip screen orientation horizontal / vertical with a shortcut icon or command. Because switching between landscape and portrait mode using Display settings on windows takes too many clicks.
Works with multiple monitors and all display orientation modes (landscape, landscape inverted, portrait, portrait inverted).
Download script <-- right click, Save as
switch second screen to portrait mode (rotate counter clockwise) :
powershell.exe -ExecutionPolicy Bypass -File "C:PATHwindows-display-orientation-script.ps1" 1 270
switch second screen to portrait inverted mode (rotate clockwise) :
powershell.exe -ExecutionPolicy Bypass -File "C:PATHwindows-display-orientation-script.ps1" 1 90
switch second screen back to landscape mode (horizontal) :
powershell.exe -ExecutionPolicy Bypass -File "C:PATHwindows-display-orientation-script.ps1" 1 0
reset all screens to default landscape mode :
powershell.exe -ExecutionPolicy Bypass -File "C:PATHwindows-display-orientation-script.ps1"
so :
... windows-display-orientation-script.ps1" 0 270
means first primary display, 90 degrees ccw to vertical... windows-display-orientation-script.ps1" 1 90
means second display, 90 degrees cw to vertical invertedrunning script without arguments resets all displays to default landscape orientation
i didn't write 90% of this code myself, i barely know how any of it works. i just mashed various pieces of code i've found on the internet that worked for me and added or modified some parts to my needs. as well as i was able. works as it is, no guarantees.
sharing it with anyone that might find it useful.