0

I have a series of IF statements in a windows batch file like so:

IF %One% == YES ( 
   myprogram1
)

IF %Two% == YES ( 
   myprogram2
)

IF %Three% == YES ( 
   myprogram3
)

even if they are all true, only the first will execute. How do I get them to wait? If I execute multiple programs within a single IF statement it behaves synchronously, running one after the other. I don't want N! if statements for obvious reasons.

I'm executing this batch file from a .NET process and redirecting the output so I don't think start /wait will work. I can't have it start a new window. What am I missing?

DSE
  • 29
  • 1
  • 1
  • 2
  • 3
    You need to post your actual code. Attempting to generalise leads to speculation, assumption and theorising. – Magoo Jul 24 '17 at 23:59
  • If one of the programs is another batch and you don't use `call` the actual batch is terminated on invoking the other. Also some programs invoke a different other and immediately terminate itself so the batch get's control back at once. Try calc.exe which invokes Calculator_10... an UWP program in Windows10 for this. –  Jul 25 '17 at 10:55

0 Answers0