Thursday, July 10, 2008

Ping All Servers In A File

Create a text file such as C:\ServerList.txt and place one server on each line. Then create a batch file with the following code that references the list.

:: multiIP.bat
@echo off
for /f "tokens=*" %%I in (C:\ServerList.txt) do call :pinger %%I

goto :eof
:pinger
echo %TIME% >> pingLOG.txt
ping %1 >> pingLOG.txt
:: DONE

0 comments: