Created
August 4, 2016 15:27
-
-
Save WizardCity/1bc3e79836b7d7b49285d7406f443d7e to your computer and use it in GitHub Desktop.
A simple cmd network connection test which writes out to a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
: Start | |
SET PT=%Date% %Time% | |
ping ww.google.ie -n 1 -w 3000 | find "TTL=" >nul | |
if errorlevel 1 ( | |
COLOR 4E | |
::echo Cannot connect to Internet | |
echo %PT% --------Not Connected--------- >> failurelog.txt | |
echo %PT% --------Not Connected--------- >> Ping.txt | |
timeout 5 > NUL | |
) else ( | |
COLOR 20 | |
::echo All is Good | |
echo %PT% >> Ping.txt | |
ping www.google.com -n 5 -w 3000| FIND "TTL=" >> Ping.txt | |
echo( >> Ping.txt | |
timeout 3 > NUL | |
) | |
GOTO Start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment