in reply to Windows Remote Desktop In Perl

Ha!!! Found a solution for my prob :-) I connected the remote computer using Telnet from local and executed all the commands, as i do in remote server after logging on with Remote Desktop. The problem before was, Telnet service was not activated in the remote server. So by typing 'services.msc' in Run, activated the Telnet process (After logging into Remote Server using RDC). This may sound silly but this is really a very big issue for me :-E Especially thanks Corion for helping me and all the monks who replied!!!!

Replies are listed 'Best First'.
Re^2: Windows Remote Desktop In Perl
by marto (Cardinal) on Jan 08, 2010 at 12:51 UTC
Re^2: Windows Remote Desktop In Perl
by Anonymous Monk on Sep 10, 2012 at 06:21 UTC
    Hi there,

    I am having the same issue as you mentioned earlier. I started the Telnet services on both the server but the script is failing with a timeout error. Could you please paste the code which is working for you?

    use warnings; use Net::Telnet; $myIPaddress = "Host IP"; $myDefaultPassword = 'pwd'; $myUsername = "username"; $myHostname = "somehostname"; $OutputFile = "$myHostname" . "_" . ".txt"; open (OUTPUT, ">>$OutputFile"); $telnet = new Net::Telnet ( Timeout=>10,Errmode=>'die'); $telnet->open("$myIPaddress"); $telnet->print("$myUsername"); $telnet->print("$myDefaultPassword"); $telnet->print("enable"); @running = $telnet->waitfor("/$myHostname# \$/i"); $running = "@running"; print OUTPUT $running; close (OUTPUT);
    Error -pattern match timed-out at C:\Lokesh\Perl\t.pl line 24 Please help... Thanks,
      Hi Muralidharan, Could you please share the working code.
      Hi Monks I executed same program,I got the following error "Unknown remote Host" ,I enable the telnet services on both servers.Please send the complete code how to connect remote server(windows).

        Can you connect to the host via another mechanism, for example telnet from the command prompt?