Solved

run client side program

Posted on 2004-04-09
10
230 Views
Last Modified: 2013-12-25
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
0
Comment
Question by:jlm661
10 Comments
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10793757

You can run a javascript

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

Author Comment

by:jlm661
ID: 10793797
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??
0
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10793836

you can say,

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

anywhere in the script.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 12

Accepted Solution

by:
venkateshwarr earned 250 total points
ID: 10793860
#!/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";

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

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


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

Author Comment

by:jlm661
ID: 10795246
sweet...thank you! i will try it tomorrow and let you know how it goes!

HTANKS AGAIN!!!
jess
0
 
LVL 84

Expert Comment

by:ozo
ID: 10798437
You'll need Content-type: text/html not text/plain to run Javascript
0
 
LVL 48

Expert Comment

by:Tintin
ID: 10809747
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.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now