views:

37

answers:

2

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?

+3  A: 

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.

Timothy Khouri
Yeah it's for launching internal programs inside a company's internal network. No spam, virus or spyware intentions, I assure you. :)
mswebersd
+1  A: 

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.

Marc Bollinger