Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Command Line *.exe on Client? 2

Status
Not open for further replies.

DJGray

Programmer
May 10, 2004
3
US
New to ASP and PHP. Writing this site in ASP but think maybe this might be easier to do in PHP, so I'm posting here.

Trying to run an executable, myApp.exe, but it needs to run on the Client machine. Basically the user selects different options on the web page and hits a Run button. OnClick, I want this to fire off an executable they will have on their machine. Well, in fact, we need to check first to see if they have the required app installed.

How does one run an exe on the client with PHP (or ASP)?

 
You can't do this with PHP, it's a server side script. It's processed on the server first and then sent to the client as HTML.

I haven't used ASP, but I'm sure it's server-side scripting as well.

You will have to look into JavaScript or another client-side language to do that.
 
You would need to create some kind of activeX object and include in the web page, convince the users to allow it in and then have the application in exactly the same place on each machine. The activeX needs to call the app..


Bastien

Cat, the other other white meat
 
Heh, I never said I used Javascript much either. Thanks for pointing that out :)
 
You cannot "push" a client to run an *.exe from the server-side. The only solution you will be able to use requires that the client is running Internet Explorer for Windows - and that they have Javascript enabled. You would then use Javascript execFile() to do the job (supplying the path to the *.exe you wish to run).

More on Microsoft's site (of course).

Jeff
 
Well, what I am trying to do, really, requires a situation that would be a virus-writer's dream. Fortunately, this will all take place on a corporate intranet.

I knew it wouldn't be easy, but what you all have done is confirmed what I am finding in my search for a way to pull this off and that is that it is just way difficult to do. Not impossible, but difficult. I do have some direction now, however, and that is helpful. Thank you for your feedback.

 
Its late and I'm grabbing at straws...

If this is being done on a corporate intranet, then all users may have access to a mapped drive that could store the executable (this will prevent your need to check if the user has an application installed).

Is it possible to pass command line options for an executable though a web link?

Code:
<a href="N:\myApp.exe -x <?php echo something; ?>">Get Results</a>

- - picklefish - -
Why is everyone in this forum responding to me as picklefish?
 
It's not a PHP, ASP etc issue, and no need in JavaScript or VBScript etc. Use (in your HTML text generated by PHP or by hand;) a link like this (Windows client-side):
Code:
<a href="file:f:/theintranet/unsafe/apps/junk.exe">Run!</a>
When a poor user clicks on Run!, IE asks him/her what to do with junk.exe object (run in place or download), then start an application...
May be, you can adjust client browser security settings for intranet zone to minimize these conversations...
I think it's a very bad practice to open access to client file system (to execute apps!) from any web page (in intranet too)...

More consistent approach is using of ActiveX'es. But without ActiveX security sertificates your users will be prompted too (or you must down user security settings)...

Alas, it seems it is not a best idea to constuct local applications menues on web pages. But you may do it, it's so simple...
 
ArkM,

Thank you for your feedback as well. As it turns out, your astonishingly simple solution works beautifully. It never occurred to me to just use a hyperlink to fire off the exe.

Also, I understand and concur with your philosophy regarding this practice. Nonetheless, I've been tasked with creating a "turnkey" solution where individuals who are unfamiliar with the "tool" can select tests they want to run via a series of checkboxes and then hit that "Run" button and the tests will run.

Behind the scenes, invisible to the user, I need to use their selections to build a test suite of the tests they want to run and configure the tool to run the specific tests they are calling for and then spit the results out to an HTML page as well as their email. It's all pretty nutty, but if it works, it will put a smile on the faces of those who sign the paychecks. ;-)

Thank you all. Your help has been invaluable.
 
OK, I understand you. There are many such individuals here.
Thank you.
Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top