How do I make a hyperlink to a local executable?

If your users really use only IE you can use this snippet:

<script type="text/javascript">
    function runNotepad() {
        var Shell = new ActiveXObject("WScript.Shell");
        Shell.Run("%WINDIR%\\notepad.exe");
    }
</script>
<a href="#" onclick="runNotepad(); return false;">Run Notepad</a>

However, with any sensible security settings this leads to an awful lot of warnings (and rightfully so!).

Leave a Comment