Last active
May 27, 2017 05:47
-
-
Save ariesmcrae/4d50d4afba030233a8f9 to your computer and use it in GitHub Desktop.
Windows batch file what will ping all servers in servers.txt and will output offline.txt if the server can't be pinged. It can't discriminate between server-not-found or server-is-down.
This file contains hidden or 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 | |
del log.txt 2>nul | |
for /f "delims=" %%a in (servers.txt) do ping -n 2 %%a >nul && ( | |
>>online.txt echo %%a&echo %%a online) || ( | |
>>offline.txt echo %%a&echo %%a offline) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment