What I mean is, when user click a button on a webpage, a program which has already installed on his computer would be executed. I also need to pass some command line parameters to the program.
We have 2 program, one is a web app, the other is a desktop program. We want to find a simple way to integrate the 2. That's why we need to execute the desktop program from a web page.
What I mean is, when user click a button on a webpage, a program which has already installed on his computer would be executed. I also need to pass some command line parameters to the program.
We have 2 program, one is a web app, the other is a desktop program. We want to find a simple way to integrate the 2. That's why we need to execute the desktop program from a web page.
Share Improve this question edited Jul 19, 2010 at 3:01 Ned Batchelder 376k77 gold badges579 silver badges673 bronze badges asked Jul 30, 2009 at 9:50 LeafGlowPathLeafGlowPath 3,7999 gold badges41 silver badges59 bronze badges 4- 5 If this were possible I'd be quite scared. – Dominic Rodger Commented Jul 30, 2009 at 9:52
- @Miles, only with some kind of signing and explicit permission from the user. – Sardaukar Commented Jul 30, 2009 at 10:03
- 1 The poster wants to run the desktop program that the user has already installed (which basically constitutes explicit permission), not an arbitrary command. I'm not saying it's a good idea, or that there aren't better ways to go about it. I'm just saying it's possible. – Miles Commented Jul 30, 2009 at 10:06
- Maybe the poster should restate the question and ask for a good strategy on how to implement this. – Sardaukar Commented Jul 30, 2009 at 10:12
8 Answers
Reset to default 11You can register a protocol to your application so that navigating to a URL beginning with that scheme will launch your application and run a command.
- [Windows](http://msdn.microsoft.com/en-us/library/aa767914(VS.85).aspx)
- Mac OS X
- Gnome
This is not possible. If it was, it would be a huge security breach.
Imagine being able to let the user click a button on the webpage and as a result format his harddrive with the standard format command? I bet you wouldn't want that happening to yourself.
Maybe you can think about exposing a webservice from your webapplication and let the desktopclient look at that webservice?
The way to do it is to register a MIME type handler for your application that is installed on the desktop. This is straightforward but different for each platform. Then, when you want to have the program run, you send a document to the user of your given MIME type.
This isn't possible for blatantly obvious security reasons.
Make a central database, tell your destop app to connect to that while web app will be connecting to that too .. so they can meet in the park
If your clients use Internet Explorer you could write an ActiveX control.
This method should probably work if you are running on Windows machine that has IIS.
Set up a Web Service (for example using Windows Communication Foundation) on the local machine that exposes a method that runs local applications.
Call that method from the webpage.
As already said, since SP2, I believe, this is not possible because it is a huge security issue.
However, for our company intranet we had the requirement to create a list of links which started all kinds of applications. I wrote an applet which handles these 'special links' and allows execuables to be started or folders to be opened etc. As this is all under our control we consider the security problem can be ignored.