Link to home
Start Free TrialLog in
Avatar of jlm661
jlm661

asked on

run client side program

hi...i have a perl script which runs a program on the server and then i would like it to run a program (pro/engineer) on the client's machine...what commands should i use? if i were running pro/e from the command line i would type

c:/proewildfire c:/TEMP/trial.txt

thanks!
jess
Avatar of venkateshwarr
venkateshwarr


You can run a javascript

<script>
   var ws = new ActiveXObject("WScript.Shell");
   ws.Exec("c:/proewildfire c:/TEMP/trial.txt")
</script>
Avatar of jlm661

ASKER

okay here is my cgi code right now

#!/usr/bin/perl -wT

use CGI;

$ENV{'PATH'} = '/usr/sbin:/usr/bin';

print "Content-type: text/plain\n\n";

$dir = "/home/edog.1/jlm661/nsga/GA/";
chdir $dir or die "Can't cd to $changedir: $!";
print "changed dir okay\n";

$result2 = system("./deviation1");
if ($result2)
{
print "Error: Couldn't run $result2: $!";
}


sub dienice {
      my($msg) = @_;
      print "<h2>Error</h2>\n";
      print $msg;
      exit;
}

so where would i put the javascript??

you can say,

print "<script> var ws = new ActiveXObject(\"WScript.Shell\"); ws.Exec(\"c:/proewildfire c:/TEMP/trial.txt\") </script>"

anywhere in the script.
ASKER CERTIFIED SOLUTION
Avatar of venkateshwarr
venkateshwarr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jlm661

ASKER

sweet...thank you! i will try it tomorrow and let you know how it goes!

HTANKS AGAIN!!!
jess
Avatar of ozo
You'll need Content-type: text/html not text/plain to run Javascript
Be aware that any Javascript/ActiveX solution is going to be very limited in its application as it will depend on things such as browser version, OS, browser settings and security settings.