View Full Version : Launch Applications with HTML?
Is there any way I can use HTML to launch a Windows application, perhaps through a link? A Google-search revealed no seemingly useful results. Can anyone help with this one?
Joe Ross
15-02-2004, 17:33
Depends on what you mean. It would a *huge* security hole if one could launch any program at any time. Imagine if the website launched "del c:\*.*".
However, if you are downloading a file, the web browser can open up an application to view the file based on extension or MIME type.
I also beleive that a java or activeX appliction can launch another application, but you would be required to lower the security settings of your browser.
There are also a few security holes in IE that could be used to do this.
As a user, I think that'd be one of the most annoying things ever. What are you trying to do, anyway? Also think of everyone out there on Mac OS, Linux, etc. You won't score big interoperabilty points there.
i have thois thought that you are trying something with fancy video...dont do it....if it cant use plug-ins and requires ana ctual application to open its annoying...trust me
Is there any way I can use HTML to launch a Windows application, perhaps through a link? A Google-search revealed no seemingly useful results. Can anyone help with this one?What exactly do you want to do?
Find out what he's thinking before you bash him, guys. :)
It was actually nothing FIRST related (for once). I was making an Intranet page for my home network and thought it's be cool to be able to launch commmonly used programs from a small navigation bar. ::shrugs:: Sorry if I offended any of you with a simple question..
I wasn't offended. I just thought that this wouldn't go over very well in the context of a robotics team site.
I wasn't offended. I just thought that this wouldn't go over very well in the context of a robotics team site.
This particular sub-forum is not only for you to " Show off your team's website", but also to "Ask for help with HTML, PHP, CSS, XML, and other website related topics". Please don't make any unnecessary and, in this case, wrong, assumptions. That's not good posting ettiquette. Next time I will make it a point to be more specific, though. So there, a lesson learned for all of us.
Anywho, does anyone have a solution to this problem? Is it possible?
Here's a way of doing this with IE and JavaScript:
<HTML>
<HEAD>
<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
function executeCommands()
{
// Instantiate the Shell object and invoke its execute method.
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "C:\\Windows\\Notepad.exe";
// Invoke the execute method.
oShell.ShellExecute(commandtoRun, "",
"", "open", "1");
}
</SCRIPT>
</HEAD>
<BODY>
<CENTER>
<Input type="Button" name="cmdNote"
value="Run Notepad" onClick="executeCommands();" />
</CENTER>
</BODY>
</HTML>
Once you save this as an HTML file and open it in IE, you can run Notepad by clicking the button. A security warning should pop up. If you want to get rid of it, modify security settings for the Local Intranet zone to allow "opening programs in an IFRAME". Be very careful when doing this. There are known (and unknown yet :)) bugs in IE that could allow an internet page to appear as if it is on the intranet. Check what security zone Outlook is in too if you use it (it should be in Internet by default, but check anyway :)) Well, you have been warned :D
You can use this technique to open any file (it does not have to be executable). And there are similar techniques for interacting with Word, Excel, etc. And by the way, I found this script on this page originally: http://www.midrangeserver.com/mpo/mpo052302-story01.html
Elgin Clock
15-02-2004, 22:39
Speaking of...
Does anyone know the specific code you use to launch mpeg, or avi files in your local player from a website??
Just put a link to the movie in in an EMBED or OBJECT (this one is better) tag. It should work in any browser, especially if you nest the tags (put EMBED inside OBJECT, just like Flash files). A better idea is to simply provide a link to the file. Movies take time to download, so its better to make it up to the user to decide. By the way, you can put video in Flash files (Flash MX and up). The compression is excellent, and everyone has the plugin. You can easily convert your mpegs to flash.
Elgin Clock
15-02-2004, 22:50
I hate the embed tag!!! It takes forever to load the page then with an embedded video file.
That is why I want to link it somehow and let it open externally in your local media player.
deltacoder1020
16-02-2004, 00:10
then just put a link to the file - if the user has a player for that type of file, it should launch automatically (the user may have to click the "Open" button on a dialog box, but that's unavoidable).
to make a video/audio open in a default program ... just make the link target to like "_new" or something ... it'll open a new ie window and then it should automatically launch the program like windows media players if u linked a .wmv etc file ... :D
deltacoder1020
16-02-2004, 12:49
just link to it - not all applications play the video inline with the browser, so you'd end up just giving a useless extra blank window to some users.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.