Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    2

    Angry Unanswered: Does anybody know how do telnet to windows 2k using perl module

    Does anybody know how do telnet to windows 2k using perl module. below is the code. getting timoeout error;however when I look at the dump.log I see the connection was maid.. Any idea..Thanks in advance...

    #!c:/Perl/bin/perl.exe

    use Net::Telnet;
    use Net::Telnet;
    my $telnet = Net::Telnet->new(Timeout => 10);
    #$telnet->dump_log("d_ump.log");
    $telnet->dump_log(<STDOUT_>);
    $telnet->open("myip_address");

    $telnet->login("username", "mypass!");

    $telnet->cmd(7);

  2. #2
    Join Date
    Oct 2003
    Posts
    2

    Thumbs up I found the way, for whom interseted..Cheers Cyrus

    use Net::Telnet;

    $telnet = new Net::Telnet ( Timeout=>5,
    Binmode=>0,
    Output_log=>'./fout',
    Input_log=>'./fin',
    Errmode=>'die');
    $telnet->open('10.10.10.1');
    $telnet->waitfor('/login: $/i');
    $telnet->print('userid');

    $telnet->waitfor('/password: $/i');
    $telnet->print('pwd');

    $telnet->waitfor('/.*C.*$/i');
    print "DBG: pass waiting for [C:\]....\n";

    @lines = $telnet->cmd("ls\r\n");
    print @lines;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •