title: How do I wait for a service/process to start before continuing a batch script?
body: <p>I am writing a windows batch script to uninstall some software. However I need to wait after the uninstaller has finished for a service to be restarted before continuing with the next uninstall.</p>
  
  <p>I can make the script wait for the uninstaller to finsh using:-</p>
  
  <blockquote>
    <p><code>for /f "usebackq" %%M in ('tasklist /nh /fi "imagename eq %process_1%"') do if not %%M==%ignore_result% goto 1</code></p>
  </blockquote>
  
  <p>But I cannot for the life of me figure out how to get the script to then wait for a service to start before continuing the script and running more uninstalls.</p>
  
  <p>I am open to any suggestions.</p>