M
Mr_Noob
Hi all,
Here is my perl script that make a telnet connection with a windows2k3
box :
#!/usr/bin/perl -w
use strict;
use warnings;
use Net::Telnet ();
my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
'/\$ $/i');
# telnet credentials
my $username = "administrator";
my $password = "mypass";
my $launcher = "c:\\\\my_bat_files\\\\test\\\\launcher.bat";
my $server = "myserver";
# Open telnet connection to $server
$telnet->open($server);
# telnet login/password
$telnet->login($username, $password);
# launch bat file
print $telnet->cmd($launcher);
But i have the following error :
"timed-out waiting for command prompt at scripts/Sanstat_launcher.pl
line 32"
I guess my "Prompt" isn't set correctly but can't find how to correct
this...
Here is how it looks like if i telnet my server manually :
$ telnet myserver
Trying 192.168.1.6...
Connected to myserver.mydomain.com.
Escape character is '^]'.
Welcome to Microsoft Telnet Service
login: administrator
password:
*===============================================================
Welcome to Microsoft Telnet Server.
*===============================================================
C:\Documents and Settings\Administrator>
thx in advance for helping
Here is my perl script that make a telnet connection with a windows2k3
box :
#!/usr/bin/perl -w
use strict;
use warnings;
use Net::Telnet ();
my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
'/\$ $/i');
# telnet credentials
my $username = "administrator";
my $password = "mypass";
my $launcher = "c:\\\\my_bat_files\\\\test\\\\launcher.bat";
my $server = "myserver";
# Open telnet connection to $server
$telnet->open($server);
# telnet login/password
$telnet->login($username, $password);
# launch bat file
print $telnet->cmd($launcher);
But i have the following error :
"timed-out waiting for command prompt at scripts/Sanstat_launcher.pl
line 32"
I guess my "Prompt" isn't set correctly but can't find how to correct
this...
Here is how it looks like if i telnet my server manually :
$ telnet myserver
Trying 192.168.1.6...
Connected to myserver.mydomain.com.
Escape character is '^]'.
Welcome to Microsoft Telnet Service
login: administrator
password:
*===============================================================
Welcome to Microsoft Telnet Server.
*===============================================================
C:\Documents and Settings\Administrator>
thx in advance for helping