Open an exe file through a link in a HTML file?

On a local computer you can do it with ease, So you have just to Create your own custom protocol, like the one used by Skype or iTunes to launch their native windows applications : - Custom protocol has to be created on Windows Registry by adding a entry as the one here :

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ACCapp]
@="URL:ACCapp Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ACCapp\shell]

[HKEY_CLASSES_ROOT\ACCapp\shell\open]

[HKEY_CLASSES_ROOT\ACCapp\shell\open\command]
@="msaccess.exe"

the word in Blod ACCapp is the name of the custom protocol that would be used on your html href link as follow

<a href="ACCapp://">PLEASE RUN MS Access exe file</a>
this link wont run unless you add the registry keys. nb: don't ever make limits to your imagination just search an you'l find. hope it helps

You can not start/execute an .exe file that resides locally on the users machine or through a site. The user must first download the exe file and then run the executable.


You can do this

it's the only way I see:

<html>
    <head>

        <title>Open exe</title>

        <script type="text/javascript">
        function runProgram()
        {
            var shell = new ActiveXObject("WScript.Shell");                 
            var appITunes = "\"C:\\Program Files\\iTunes\\iTunes.exe\" ";
            shell.Run(appITunes);
        }        
        </script>

    </head>



    <body>

        <a href="javascript:runProgram()">Run program</a>

    </body>

</html>

Due security reasons it's not possible, and probably it's better it stays that way.

The following code works, but only on the machine which the program exists on:

<a href = "c:\Myfolder\Myprogram.exe">

Tags:

Html