Tutorial :How to run a executable file 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.


You 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.


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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »