Hi,

I am trying to telnet from a WinXP machine to another WINNT Svr and execute a series of Batch files. I am able to login successfully and change directories. However, PERL times out at this place. It doesn't go onto the next line. Here is my code:

#!C:\Perl\bin\perl use warnings; use Net::Telnet; $telnet = new Net::Telnet ( Timeout=>40, Dump_log=>'dump.log', Input_log=>'input.log', Output_log=>'output.log', Errmode=>'die'); $telnet->open('x.x.x.x'); $telnet->waitfor('/login/'); $telnet->print("vtat"); print "Login Entered\n"; $telnet->waitfor('/password:/'); $telnet->print("vtat"); print "Password Entered\n"; $telnet->waitfor('/.*\\n/'); $telnet->cmd("cd c:\\Documents and Settings\\vtat\\SCRIPTS\\SCL"); $telnet->waitfor('/.*\\n/'); print $telnet->cmd("Batchfile1.bat"); $telnet->waitfor('/complete/'); print $telnet->cmd("Batchfile2.bat $telnet->close;

Here is the output from the input.log file,

Welcome to Microsoft Telnet Service login: vtat password: *=============================================================== Welcome to Microsoft Telnet Server. *=============================================================== C:\Documents and Settings\vtat>cd c:\Documents and Settings\vtat\SCRIP +TS\SCL C:\Documents and Settings\vtat\SCRIPTS\SCL>

Thank you for your suggestion.


In reply to PERL Telnet Times Out by katwala

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.