title: How to run a batch script through javascript?
body: <p>I know that this is frowned upon, but how can I run a batch file through javascript? I have tried three things:</p>
  
  <p>1)</p>
  
  <pre><code>var oShell = new ActiveXObject("Shell.Application");
  oShell.ShellExecute("test.bat", "","", "open", "1");
  </code></pre>
  
  <p>2)</p>
  
  <pre><code>document.location.href='test.bat';
  </code></pre>
  
  <p>3)</p>
  
  <pre><code>WshShell = new ActiveXObject("WScript.Shell");
  WshShell.Run("test.bat");
  </code></pre>
  
  <p>Still no luck.</p>
  
  <p>Thanks.</p>