So, Doing some exploring, I was able to remotely launch applications on the remote server on my own personal Winsta. From there I wanted to see if I could automate mouse and keystrokes.
The full window (include children windows) seems to act as one class “Rail_Window” and doesn’t uncover the underlying Control’s / Forms. So I stayed safe and decided to use just keystrokes but FOCUS command in AutoIt is not working with this window class, so I deiced to use a Minimize / restore combo to bring it to the forefront of my desktop then send it keys like below. This may open another possibility to automate server workflow processes without the need for additional software installation. Heck even adding Bitblt I could even capture images and use them to target mouse clicks on the remote machine if I really need it.
http://controllingtheinter.net/2018/05/25/creating-a-citrix-like-session-with-powershell-and-rdp/
http://controllingtheinter.net/2018/05/24/creating-a-virtualized-application-on-a-remote-server-local-on-your-desktop/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Opt("WinDetectHiddenText", 1) ;0=dont detect, 1=do detect $hWnd = WinGetHandle("Calculator (Remote)") If @error Then $cmd = WinGetHandle("Administrator: C:\Windows\System32\cmd.exe (Remote)") WinSetState($cmd, "", @SW_MINIMIZE ) WinSetState($cmd, "", @SW_RESTORE ) ControlSend ( $cmd, "", "", "^c") ControlSend ( $cmd, "", "", "calc{enter}") Sleep(1000) EndIf WinActive("Calculator (Remote)") $hWnd = WinGetHandle("Calculator (Remote)") WinSetState($hWnd, "", @SW_MINIMIZE ) WinSetState($hWnd, "", @SW_RESTORE ) ControlSend ( $hWnd, "", "", "587") Sleep(1000) ControlSend ( $hWnd, "", "", "!vp") Sleep(1000) ControlSend ( $hWnd, "", "", "!vt") Sleep(1000) |