Why not just make a CGI wrapper around the program that you want to execute? Or use SOAP? | [reply] |
Thank you all for your comments. Being fairly new to Perl, i do not know how to use a cgi wrapper or SOAP. do you or anyone else have any examples. Anything will help.
Thanks,
Ray
| [reply] |
For SOAP, you might want to start here. CGI information is all over the place. You could buy a book, like this one, or read one of the thousands of free ones on-line.
| [reply] |
I'm not sure if I understand exactly what you want to do, but you could use the cmd method of Net::Telnet.
The code would look something like this:
use Net::Telnet ();
my $tn = Net::Telnet->new(Timeout => 15, Prompt => '/host:\/home\/dir\
+>/');
my $host = 'some.host.xxx';
my $login = 'test';
my $passwd = 'testpw';
$tn->open($host);
$tn->login($login, $passwd);
my $msg = $tn->errmsg;
if ($msg) {
print "A system error was generated on the login attempt:\n";
print " '$msg'\n\n";
}
my @list = $tn->cmd("./prog.p");
my $msg = $tn->errmsg;
if ($msg) {
print "A error occurred when attempting remote cmd './prog.p':\n";
print " '$msg'\n\n";
}
my $ok = $tn->close;
if (not $ok) {
print "\nUnable to close Telnet connection to HOST: $host\n\n";
exit;
}
Hope this helps.
If the code and the comments disagree, then both are probably wrong. -- Norm Schryer | [reply] [d/l] [select] |
You can do it with WMI. You'll need to use Win32::OLE to access it. I don't have any code for that, but if you look in MSDN - you'll find the WMI schema. It's fairly complicated - you'll probably need to run the script as member of administrators group
You could also just use psexec from Sysinternals (the PSTools suite).
Or you could take perrin's excellent advice and just use CGI on the remote server - use a password protected directory and encrypt login with SSL.
Error: Keyboard not attached. Press F1 to continue. | [reply] |
| [reply] |