Last active
August 29, 2015 14:10
-
-
Save vishalkardode/a213315cc97d2eabff44 to your computer and use it in GitHub Desktop.
Ping TestPings servers from text file and exports results to another text
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
| 127.0.0.1 | |
| 172.21.32.179 |
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 | |
| REM @author Vishal | |
| if exist computers.txt goto Label1 | |
| echo "Cannot find computers.txt" | |
| Pause | |
| goto :eof | |
| :Label1 | |
| echo PingTest executed on %date% at %time% > z.txt | |
| for /f %%i in (computers.txt) do call :Sub %%i | |
| goto :eof | |
| :Sub | |
| echo Testing %1 | |
| set state=alive | |
| ping -n 1 %1 | find /i "bytes=" || set state=dead | |
| echo %1 is %state% >> z.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment