title: Batch Command to catch all possible ping issues
body: <p>I have a question regarding verifying that a ping is returning properly in a batch command.  Currently I have to check a ping 3 different ways to know that the server is in fact up.  I want to combine these into one single ping command.  I have tried using different error levels or not errorlevel 0 etc.  None of them catch all possible scenarios.  Here is what I have been using:</p>
  
  <pre><code>Set /p domain=Enter IP address:
  set state=up
  
  @ping.exe -n 1 %domain% | find "unreachable" &gt; null &amp;&amp; set state=down
  if "%state%" == "down" goto :NoServer
  
  @ping.exe -n 1 %domain% | find "TTL expired" &gt; null &amp;&amp; set state=down
  if "%state%" == "down" goto :NoServer
  
  @ping.exe -n 1 %domain%
  if errorlevel 1 goto :NoServer
  </code></pre>