title: Check if service is running without using Find command
body: <p>In a batch file I'm trying to check if a service is started, if not then wait.</p>
  
  <p>Now to check if a service is running, I am doing this:</p>
  
  <pre><code>sc query "serviceName" | find /i "RUNNING"
  if "%ERRORLEVEL%"=="0" (
      echo serviceName is running.
  ) else (
      echo serviceName is not running
  )
  </code></pre>
  
  <p>Trouble is the errorlevel is always set to 0. Possibly because of this known <a href="http://support.microsoft.com/KB/106203" rel="nofollow">Find bug</a>.
  Is there any alternate way to check if a service is started, if not then wait?</p>