Solved

run client side program

Posted on 2004-04-09
10
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
How our DevOps Teams Maximize Uptime

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

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

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…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to dynamically set the form action using jQuery.

749 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