Hello,
Please comment and explain each liner of the script.
@echo off
if exist d:\tools\computers.txt goto Label1
echo.
echo Cannot find d:\tools\computers.txt
echo.
Pause
goto :eof
:Label1
echo PingTest executed on %date% at %time% > d:\tools\z.txt
echo ================================================= >> d:\tools\z.txt
for /f %%i in (d:\tools\computers.txt do call :Sub %%i
notepad d:\tools\z.txt
goto :eof
:Sub
echo Testing %1
set state=alive
ping -n 1 %1 | find /i "bytes=" || set state=dead
echo %1 is %state% >> d:\tools\z.txt