General discussion

Locked

Anybody know how to open application from HTML link?

By H-man ·
Does anybody know a simple way to start an application such as an exe or multimedia file from a html link, without been given the option of saving to disk etc.
I have heard of java scripts that will do this however I have not come across any.

Thanks much.

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

re: Anybody know how to open application from HTML link?

by bigdog In reply to Anybody know how to open ...

make sure you specify the correct mime-type for the file that is to be used. Also the user needs to have support for that mimetype in their browser. For example, take pdf files which opens up a pdf viewer application like Acrobat or xpdf (linux).

Collapse -

here's a code sample

by read In reply to Anybody know how to open ...

Try something like the following (see script below).

Keep in mind that IE and other browsers will prompt the user for permission to substantiate the ActiveX control. You can get around this if this is for users on a corporate network by getting them to either click "yes" every time they launch it, or by changing the security settings in their browser (in IE this is Tools.Internet Options.Security).

Following is a JScript example. You could code this with VBScript if you prefer.

<html>
<head><title>Run EXE Test</title>

<script type="text/javascript" language="JavaScript">
function RunCalc() {
var shell = new ActiveXObject("WScript.shell");
shell.run("calc");
}
</script>

</head>
<body>
<a href="#" onclick="RunCalc();">Run Calculator</a>
</body>
</html>

Collapse -

Windows-specific

by read In reply to here's a code sample

Keep in mind as well that this is a very Windows-specific solution.

Collapse -

Get around security issues with HTAs

by jamie In reply to here's a code sample

If you run the above script in the context of an HTA, or HyperText Application, you can get around the constant "clicking yes" problem described above. Further, you can save files to the hard drive, and do anything else you'd be able to do from an "installed" application. Here is more info...

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums