title: IF there are results to a command then, IF no results then for batch scripting
body: <p>I need to create a batch script.</p>
  
  <p>This script should be able to detect whether there are results or not.</p>
  
  <p>I am using the command</p>
  
  <pre><code>dsquery domainroot -inactive 60
  </code></pre>
  
  <p>It tells me all of the accounts that have been inactive for 60 days.</p>
  
  <p>I run the same command for 180 days and I get no results.</p>
  
  <p>I run the command for 60 days and I get results.</p>
  
  <p>I need to create exit codes to determine if there are or aren't any results.</p>
  
  <p>The errorlevels for each of these are 0 (with and without results).</p>
  
  <p>Is there any other way to detect if there are results or not. So I can get this into an IF statement.</p>