how to execute batch file one by one in javascript
<p>I have to execute two batch files in javascript. The following is my code.</p>

<pre><code>var shell = new ActiveXObject('WScript.Shell');
shell.Run('c:\\batch1.bat');
 shell.Run('c:\\batch2.bat');
</code></pre>

<p>What happens according to the above code is that both the batch files are executed simultaneously. but that is not what i want, I want the batch1.bat to execute first and then when it finishes execution then it should start with execution of batch2.bat. how can this be done in javascript.</p>

<p>Thank you for your help in advance,</p>
