Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch Program from IE

Is it possible to launch a program from an anchor in IE? For example, iTunes had links like itms:blahblah that would open up iTunes and go directly to the appropriate page. If so, what is the best way to do this?

like image 741
getWeberForStackExchange Avatar asked Mar 18 '10 00:03

getWeberForStackExchange


2 Answers

If you're talking purely from the browser, you can't register your own "protocol"... the thing is that when you installed iTunes, it registered the itms protocol so that any link that looks like this:

<a href="itms://something.mp3">click me</a>

Would open up the iTunes app. You can't do that (without running your own executable first which registers your custom protocol with the computer), but, what you can do is make a link to a file on our local computer... example:

<a href="file://c:/windows/notepad.exe">Launch Notepad</a>

I, of course, am assuming that you're making a simple HTML page that is meant for your own internal use (or on your companies internal network) to launch known programs from your computer.

like image 167
Timothy Khouri Avatar answered Sep 25 '22 22:09

Timothy Khouri


Yes, but not without help. Your protocol has to be registered on the user's computer, which can be done via ftype. I'd assume that what you're seeing is the product of the iTunes installer registering itms. If you type ftype itms at the command line, you're likely to get something like itms=C:\Program Files\iTunes\iTunes.exe /url "%1".

That is to say, no, you can't do it just from inside the browser, that would be a terrible, horrible, no-good, very-bad security hole.

like image 32
Marc Bollinger Avatar answered Sep 21 '22 22:09

Marc Bollinger