Solved

run client side program

Posted on 2004-04-09
10
236 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

821 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