Hi Travs69
It runs on some PCs so doesn't seem that code is the problem.
This is the code:
use strict;
use Net::Telnet;
use File:

ath;
#use warnings;
my $Server=$ARGV[0];
my $username=$ARGV[1];
my $password=$ARGV[2];
my $sCommand=$ARGV[3] . ";echo Auto_Done";
my $expectedprompt=$ARGV[4];
my $timeoutforsync=$ARGV[5];
if($expectedprompt eq "")
{
$expectedprompt="Auto_Done";
}
my $FILE_NAME = 'c:/test.txt';
my %enterarr;
my $t = new Net::Telnet (Timeout => 30,Port=>23,Host=>$Server,Errmode=>'return');
my %cmdArr=("Name"=>$username, "Password"=>$password, "Prompt"=>"/>/", "Timeout"=>$timeoutforsync, Errmode=>'return');
my $ok=$t->login(%cmdArr);
my $msg = $t->errmsg;
if($msg ne "")
{
open (my $fh,">",$FILE_NAME) or die "could not open '$FILE_NAME'\n";
print $fh ("UNIX ERROR\n");
print $fh ("Message returned from UNIX: \n");
print $fh ("$msg");
close($fh);
exit;
}