http://www.perlmonks.org?node_id=1081065

pradeep,krishna has asked for the wisdom of the Perl Monks concerning the following question:

Hi fellow monks.
I am using Win32::GuiTest module and mstsc.exe for remote desktop connection.
My Automation job is to keep the user logged into the system. So I have to close the RDC window. I used the method Win32::GUIRobot qw(CloseWindow); but , for that it is popping up an alert message. To eradicate it I want to execute the command tsdiscon on that RDC.
The problem is I don't know how to execute commands on RDC.
Help me on this
Thanks in advance.

  • Comment on How to execute commands on remote desktop connection?

Replies are listed 'Best First'.
Re: How to execute commands on remote desktop connection?
by Anonymous Monk on Apr 04, 2014 at 06:38 UTC

    The problem is I don't know how to execute commands on RDC.

    Sorry but you're not going to find the answer on perlmonks

    Win32 knowledge lives on MSDN

    I believe what bulk88 said in How to set text to text boxes? -- flat pixels aren't windows you can send messages to, they're flat pixels -- you're going to have to run a program on the remote desktop to control the remote desktop by sending messages to windows/dialogs...

Re: How to execute commands on remote desktop connection?
by dasgar (Priest) on Apr 04, 2014 at 13:41 UTC

    Since you're on Windows, I'd recommend looking into using psexec, which is part of the Sysinternals set of tools. From your Perl code, you would use system to call psexec.