How to launch an EXE from Web page (asp.net)

This assumes the exe is somewhere you know on the user’s computer:

<a href="https://stackoverflow.com/questions/916925/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).

Leave a Comment