title: Pinging to multiple servers via windows batch script
body: <p>I'm trying to check response from list of <strong>n-thousand IPs</strong> using ping command via <strong>windows batch script</strong> and save all results in a file (<strong>yes</strong> if response and <strong>no</strong> if don't). Is this even possible via batch script? When I'm using script printed below (<em>pingingN.bat</em>) I'm getting only first IP answer.</p>
  
  <pre><code>@ECHO OFF
  
  SET ServerList="C:\MyPath\ip.txt"
  SET LogFile="C:\MyPath\PingResults.txt"
  
  IF EXISTS %LogFile% DEL %LogFile%
  
  FOR %%a IN (%ServerList%) DO (
      ping -n 1 %%a | find "TTL=" &gt; NUL
      IF %ERRORLEVEL% NEQ 0 (
          echo no &gt;&gt; %LogFile%
      ) ELSE (
          echo yes &gt;&gt; %LogFile%
      )
  )
  </code></pre>