0

I have a batch file ("ABC.bat") whose contents are as follows:

x.bat
y.bat
z.bat

Now I want to run all the 3 batch files (x, y and z) whenever ABC.bat is run.

What's happening is when "x.bat" is failing to run for some reason, the other 2 batch files (y and z) are not running. (i.e "ABC.bat" stops its execution there)

I want even if "x.bat" fails, the next batch files should run.

Kindly let me know what are the options to be added or if there is any other way to do it?

Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
  • You need to use the `call` command to sub a batch. Otherwise control is just transferred. See `call /?`. In your code `y` and `z` never run. –  May 23 '16 at 05:02
  • possible duplicates [1](http://stackoverflow.com/a/36649618/2152082), [2](http://stackoverflow.com/a/36799447/2152082) – Stephan May 23 '16 at 05:44
  • If running them in parallel is an option, you can also use `start` instead of `call` – Florian Straub May 23 '16 at 08:53
  • Thanks. using "call" worked. – Pabitra.Giri May 23 '16 at 11:36
  • 1
    Possible duplicate of [How to run multiple .BAT files within a .BAT file](http://stackoverflow.com/questions/1103994/how-to-run-multiple-bat-files-within-a-bat-file) – Ross Ridge May 23 '16 at 16:30

0 Answers0