title: batch file for sporadic internet connection
body: <p>i've seen pingers and auto redials when theres a request time out.</p>
  
  <p>problem:
  but im having a hard time researching the 'counter or increment' part.</p>
  
  <p>idea:
  heres how it should be:</p>
  
  <p><strong>start pinging continuously while connected to internet,
  otherwise
  count (or accumulate) request time out until 1min or 60 request time out, 
  if connection went back after request time out &amp; less than '60 times request time out',reset the 
  'request time out counter' to zero
  if request time out reached 60x :
  run another batch or reconnect re-dial up.
  loop to internet connection pinging</strong></p>
  
  <p>the closest that i saw:
  (but for some reason its not working on my xp)</p>
  
  <pre><code>@echo off
  setLocal EnableDelayedExpansion
  
  :loop
  
  ping -n 2 10.174.10.48 &gt;&gt; log
  find /i "Reply" &lt; log &gt; nul
  if not errorlevel 1 type nul &gt; log &amp; goto :loop
  
  for /f "tokens=1" %%a in ('find /c /i "Request timed out" ^&lt; log') do (
  if %%a geq 10 echo file.exe &amp;&amp; type nul &gt; log
  )
  goto :loop
  </code></pre>
  
  <p>source: <a href="http://www.computing.net/answers/programming/ping-bat-file/16605.html" rel="nofollow">http://www.computing.net/answers/programming/ping-bat-file/16605.html</a></p>
  
  <p>credits to the original poster.
  thank you</p>