Ping multiple hosts and output to a text file - nirvikk/ncr GitHub Wiki

Put all the hostnames to a text file "servers.txt" and create a text file "PingResults.txt" to output results

Run the following command:

for /f "tokens=1" %a in (servers.txt) DO @ping %a >> PingResults.txt