1.

Solve : Help needed on START command on .bat files?

Answer»

Hi all,

I'm trying to run six applications but in two sequences. So I want three programs to run first, and well all have FINISHED I want the next three to run and when they finish I NEED the window to close as this whole script is initiated with a program that needs to continue.

How it is set up:
[Application executes my script (I cannot control how that is done!)]
  - My script:
Code: [Select]start /wait pst_set1.bat
start /wait pst_set2.bat  - The pst_setX.bat FILES start three applications each using start command so that they run simultanously. I cannot use /wait in this file, as I don't know which will finish first (will ALWAYS be different and this whole thing will run numerous times.

Using this code I need to manually type "exit" after each batch file is completed since the start command automatically adds /K to the cmd command. Adding exit to the script does not work.

Using call does not work either, since the start command in the following files will make the batch continue right away. And I need to wait for the six applications finish their job.

So does anyone have a tip on this? Is there a way to use START with batch files while not using the /K command, forcing it to close after it completes?
I have also tried, without success:
Code: [Select]start /wait cmd /c pst_set1.bat
start /wait cmd /c pst_set2.bat

Or is there a way to make this only one batch file that uses START to run the applications in pairs, without using /wait? An option to use /wait will only be possible if I can apply it to a group of applications, i.e. that it waits for ALL three applications to finish before it CONTINUES. Is that possible?

Thank you for your time,
hureka



Discussion

No Comment Found