In particular, I am really hoping to get advice on a way to a) select each RDP window that I open, and then b) resize and position that window to a particular location on the screen. Does anyone have a recipe for achieving that (very generally useful to me to be able to pick a window a resize as required!)?
Code: Select all
/*
Remote Desktop Logon
Logon to Remote Desktop and size the windows correctly for a split screen setup
Note that in a dual screen display can have a Start Bar or no Start Bar.
These settings are for a screen with resolution of 1920x1200, and no Start Bar.
Easy to adjust for other resolutions.
height := 1126 ; perfect height if have a Start Bar on this display for the RDP session
height := 1176 ; perfect height for Start Bar and maximise to left of screen
*/
servername := "server1.mydomain.net"
username := "mydomain\myusername"
password := "mypassword"
width := 952 ; halfway for a 1920 wide display, 957 if can find a way to maximise to left/right
height := 1168 ; correct height to account for window borders, use 1126 / 1176 if Start Bar present
; MsgBox, ,RDP Details, %servername%`n%username%`n%password%`n%width% %height%, 2
Run, mstsc /console /v:%servername% /w:%width% /h:%height%
Sleep, 6000
WinActivate, Windows Security
Send, %password%
Send, {ENTER}
servername := "server2.mydomain.net"
username := "mydomain\myusername"
password := "mypassword"
width := 952 ; halfway for a 1920 wide display
height := 1168
; MsgBox, ,RDP Details, %servername%`n%username%`n%password%`n%width% %height%, 2
Run, mstsc /console /v:%servername% /w:%width% /h:%height%
Sleep, 6000
WinActivate, Windows Security
Send, %password%
Send, {ENTER}