views:

68

answers:

3

Is there a way to allow an HTML file to open an application on the local computer and send that application arguments?

We have an application that allows a user to set a link to an external application. We also provide a summary page in HTML (they usually interact with the application from outside the browser) with the link in HTML as well. We can get applications to launch if the program exists, but cant seem to send arguments through the HTML link.

Is this even possible?

Is it possible without installing something client-side (like silverlight/java web start/etc)?

+2  A: 

You can't directly launch an application from HTML/JavaScript. If you have a custom application already installed, you can register a protocol handler and the redirect to that custom url, which in turn launches your application with the full url available. Something like:

mycustomapp://whatever/wahtever?arg1=value&arg2=value
Sam
+1  A: 

http://msdn.microsoft.com/en-us/library/bb774148%28VS.85%29.aspx

Kyle Alons
This is MSIE proprietary which requires ActiveX enabled with pretty loose security settings. Won't work in all other browsers the world is aware of and won't work without any annoying security warnings in the default MSIE setup.
BalusC
True, but the question was whether it's possible and didn't stipulate client requirements.
Kyle Alons
@Kyle Alons, answer is valid, but would have been better if it included the caveats BalusC mentioned.
Sam
most of our clients are running Windows machines/probably IE so i dont think that should be too much of an issue (famous last words though).
Jugglingnutcase
A: 

Another possibility is to embed a client application in your webpace, such as Java applet (signed!), Java webstart, Silverlight, etc and let that application instead invoke the client's local application. In Java applet/webstart for example, you can use Desktop#open() for this.

BalusC