title: How to check service startup type from batch script? (in windows 7)
body: <p>I need to start a service from batch file (using <code>sc start XXX</code>), but ONLY if it is configured with an automatic start up type.</p>
  
  <p>I read the instructions of <code>sc /?</code> and I tried calling first to <code>sc qc XXX</code> command in order to query for it's configuration and then use findstr on the result, but I got the following error after <code>sc qc XXX</code> command:</p>
  
  <pre><code>[SC] QueryServiceConfig FAILED 122:
  
  The data area passed to a system call is too small.
  
  [SC] GetServiceConfig needs 718 bytes
  </code></pre>
  
  <p>The specified service does not exist as an installed service.</p>
  
  <p>Which is odd, because I am able to call <code>sc config XXX</code> and stop/start it from command line.</p>
  
  <p>Am I missing something? Is there a better way to do it?</p>