title: Run a bat file from javascript
body: <p>I'm trying to run a bat file using javascript. I've tried using powershell but it didn't seem to work properly. Here is the code I tried:</p>
  
  <pre><code>var oShell = WScript.CreateObject("WScript.Shell");
  oShell.Exec("D:");
  oShell.Exec("cd dir");
  oShell.Exec("start user.bat");
  </code></pre>
  
  <p>I've also tried that:</p>
  
  <pre><code>var oShell = WScript.CreateObject("WScript.Shell");
  oShell.Exec("start D:\dir\user.bat");
  </code></pre>
  
  <p>Sometimes it runs, sometimes I get those errors "Expected hexadecimal digit", "Access is denied".
  I'm really confused. All I'm trying to do is execute a bat file from a javascript file.</p>
  
  <p>Anyone has any idea how to do it? Thank you!</p>