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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |