批量自动PING

@echo off
 color 1A
 setlocal enabledelayedexpansion
 echo *
 echo *  正在执行,请勿关闭窗口,请等待……..*
 echo *
 pushd "C:\Users\%username%\Desktop"
 if exist result.txt (del result.txt goto step1)
 :step1
 if exist report.txt (del report.txt goto step2)
 :step2
 if exist report1.txt (del report1.txt goto Ping)
 :Ping
 for /f %%i in (domain.txt) do ping %%i -n 1 >>report.txt
 findstr /i /c:"Ping" report.txt >report1.txt
 for /f "tokens=3,4" %%a in (report1.txt ) do echo %%a %%b>>result.txt
 del report.txt
 del report1.txt
 echo * echo 域名检测完毕,请查看桌面result.txt…….. echo *
 pause
 exit

发表回复