title: IF STATEMENT for PINGS
body: <p>I work in a small IT department that has multiple users in other external offices and have made a basic (Windows) PING command batch script that pings each office to check they are online. I simply run the .bat file and leave it in the corner of my screen.</p>
  
  <p>If a ping fails it turns the background red, if it works it stays blue. Here is the content:</p>
  
  <pre><code>@echo off
  COLOR 97
  :start
  echo EXTERNAL CHECK
  PING www.google.com
  IF %ERRORLEVEL% EQU 0 COLOR 97
  IF %ERRORLEVEL% EQU 1 COLOR 47
  echo SITE A CHECK
  PING x.x.x.x
  IF %ERRORLEVEL% EQU 0 COLOR 97
  IF %ERRORLEVEL% EQU 1 COLOR 47
  echo SITE B CHECK
  PING x.x.x.x
  IF %ERRORLEVEL% EQU 0 COLOR 97
  IF %ERRORLEVEL% EQU 1 COLOR 47
  echo SITE C CHECK
  PING x.x.x.x
  IF %ERRORLEVEL% EQU 0 COLOR 97
  IF %ERRORLEVEL% EQU 1 COLOR 47
  echo SITE D CHECK
  PING x.x.x.x
  IF %ERRORLEVEL% EQU 0 COLOR 97
  IF %ERRORLEVEL% EQU 1 COLOR 47
  goto start
  </code></pre>
  
  <p>I am pretty new to scripting so apologies for any stupid errors. If anyone has any suggestions to improve it I would welcome them. I hope this helps people though!
  Rob</p>