title: Batch file to wait for other program to load/initialize, then execute command?
body: <p>I need some assistance writing what should be a fairly basic .BAT file.</p>
  
  <p>I load my main program, but that program takes ~20secs to load and be initialized.</p>
  
  <p>I have another command-line API I can execute to interact with this above program, but obviously until the above program is loaded and initialized there's no point in trying.</p>
  
  <p>If the program isn't running the command-line API returns a string stating exactly this - otherwise it just works and exits. Easy.</p>
  
  <p>So I want to wait until the above is loaded/initialized before firing my API command(s) at it.</p>
  
  <p>I <em>could</em> place a sleep/wait in there, but I want something more solid.  The ~20sec wait is not necessarily consistent.</p>
  
  <p>Any way to execute the command-line API over and over until the response is satisfactory, then exit?</p>
  
  <p>J</p>