title: How to run a .bat file using javascript
body: <p>I know there are some browser issues associated with running a bat file from javascript, but the below code doesnt work on chrome nor on ie</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function runApp(which) {
    WshShell = new ActiveXObject("WScript.Shell");
    WshShell.Run (which,1,true);
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;!-- Two ways to create a link to run the app. --&gt;
  &lt;font onClick="runApp('file:C:/path/to/batfile.bat');" style="cursor: hand;"&gt;&lt;u&gt;Notepad&lt;/u&gt;  &lt;/font&gt;
  &lt;br&gt;
  &lt;!-- Or use &lt;a&gt; descriptor --&gt;
  &lt;a href="runApp('file://c:/test.bat');"&gt;Batch File&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>