title: Running a batch file present in Apache server using javascript
body: <p>We are trying to run a bat file present in apache server using the java script.
      We are getting following error “Automation server cannot create the object”
      Please find the below code and let us know how to resolve the issue</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;script&gt;    
      function testing() {
          alert("Execution will start");
          WshShell = new ActiveXObject("WScript.Shell");
          alert("after webShell");
          //var commandtoRun = "C:\\Program Files\\Apache Group\\Apache2\\htdocs\\application\\gui\\templates\\execute\\test.bat";
  
          WshShell.Run ("\"C:\\Program Files\\Apache Group\\Apache2\\htdocs\\application\\gui\\templates\\execute\\test.bat\"");
  
          alert("after webShell");
  
      }
  
      &lt;/script&gt;
  
  &lt;/head&gt;
  
  
      enter code here
      &lt;body&gt; 
  
      &lt;form&gt;
  
      &lt;p id="demo"&gt;Running scripts &lt;/p&gt;
      &lt;input type="button" onclick="javascript: testing ();" value="Run Scripts" /&gt;
      &lt;button onclick="javascript: testing ();"&gt;Run bat File&lt;/button&gt;
  
      &lt;/form&gt;
      &lt;/body&gt;
  
      &lt;/html&gt;
  </code></pre>