flamey has asked for the wisdom of the Perl Monks concerning the following question:

Trying to find a solution to automate a task I have to perform often:

  1. connect from one WinXP machine to another via Remote Desktop Connection
  2. find one of the open windows that I need (there can be many windows open, and I cannot close them)
  3. click a couple of buttons, and open a file via Browse dialog
  4. disconnect from RDC

I looked at Win32::GuiTest and looked at RDC window with WinSpy++.. I guess I could send some keystrokes to the RDCto navigate in a Window currently active there. But I cannot figure out how I can make sure my window is active.

What other options I have? Can this be done?

  • Comment on Automating GUI tasks on the remote Windows PC

Replies are listed 'Best First'.
Re: Automating GUI tasks on the remote Windows PC
by Corion (Patriarch) on May 31, 2010 at 20:45 UTC

    If all else fails, you can try an approach like with vnccapture (except you'll need to write rdccapture), together with some "image recognition" that recognizes bitmaps and translates them back to UI elements again. This is likely highly brittle but might still work.

Re: Automating GUI tasks on the remote Windows PC
by Anonymous Monk on May 31, 2010 at 17:39 UTC
Re: Automating GUI tasks on the remote Windows PC
by aquarium (Curate) on May 31, 2010 at 23:53 UTC
    in my opinion not a good idea to log in with a program into remote desktop to perform operations. If something goes wrong, and you won't be there to see it, it could potentially create havoc. There are established/commercial software to administer remote servers, with much fewer risks.
    the hardest line to type correctly is: stty erase ^H
Re: Automating GUI tasks on the remote Windows PC
by wwe (Friar) on Jun 01, 2010 at 09:46 UTC
    Maybe you can run your tool local on the other system. Even in case you don't have Perl installed there you can pack the script with pp and run the exe. In this case you don't need to handle with rdp and additional windows. Then you may send the result to the other machine (if you want).