I have to execute two batch files in JavaScript. The following is my code:
var shell = new ActiveXObject('WScript.Shell');
shell.Run('c:\\batch1.bat');
shell.Run('c:\\batch2.bat');
What happens according to the above code is that both the batch files are executed simultaneously. However, 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.
Thank you in advance for your help.