This is an internal web application where we would like the Web pages to contain links to several utilities that are Win32 EXE. The EXEs are trusted and produced by us. (don't care if it asks if its ok to Run or Save). I tried direct link (e.g. C:\notepad.exe) which works locally only. (This will be a share on the network). Tried File:/// and did not work. IE7 is the browser needed.
So you really can't launch .exe files from a browser with any much success - it simply a security hole the size of open barn door. You might get some success opening up some trusted locations for the browser - but it is a difficult challenge at best.
This assumes the exe is somewhere you know on the user's computer:
<a href="javascript:LaunchApp()">Launch the executable</a> <script> function LaunchApp() { if (!document.all) { alert ("Available only with Internet Explorer."); return; } var ws = new ActiveXObject("WScript.Shell"); ws.Exec("C:\\Windows\\notepad.exe"); } </script>
Documentation: ActiveXObject, Exec Method (Windows Script Host).
How about something like:
<a href="\\DangerServer\Downloads\MyVirusArchive.exe" type="application/octet-stream">Don't download this file!</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With