@echo off&color f1
setlocal enabledelayedexpansion
set "f1=a.txt"
set "f2=b.txt"
set/p item=<"%f1%"
set js="usebackq skip=1 tokens=1-7 delims=,"
for /L %%i in (1,1,52)do set "fe=!fe!="
(echo %item%,NETstate,Time
echo %fe%
for /f %js% %%a in ("%f1%") do (
echo !time:~,8! Ping %%e
>nul ping -n 1 %%e&&(
set state=在线&set/a on+=1)||(set state=断线&set/a off+=1)
title pinging %%e ... 累计 通/断 = !on! / !off!
set "ptime=!date:~,4!!date:~5,2!!date:~8,2!!time:~,2!!time:~3,2!"
echo %%a,%%b,%%c,%%d,%%e,%%f,%%g,!state!,!ptime: =0!
))>"%f2%"
set/a m=on+off
title ping 文件%f1% 中所列IP测试结束 ... %on% + %off% = %m%
echo;&echo 共Ping IP %m% 个 (通 %on% 个, 不通 %off% 个)
set/p=已记录到文件%f2%中。请按任意键退出... nul