我想编写一个批处理文件来ping像1.30.200.3
一个IP地址:命令提示符编程一批
Pinging 1.30.200.3 with 32 bytes of data:
Reply from 1.30.200.3: bytes=32 time=28ms TTL=124
Reply from 1.30.200.3: bytes=32 time=28ms TTL=124
Reply from 1.30.200.3: bytes=32 time=27ms TTL=124
Reply from 1.30.200.3: bytes=32 time=27ms TTL=124
Ping statistics for 1.30.200.3:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 27ms, Maximum = 28ms, Average = 27ms
我要问,如果在"Received" >= 2
型只有这样一行:
Reply from 1.30.200.3: bytes=32 time=28ms TTL=124
否则
类型有多少收到和"Failure"
输出像这样 如果接收到的比且等于2包
“从1.30.200.3答复:字节= 32时间= 28ms TTL = 124”
或者,如果不大于等于和2 输出像此
“接收= 0 &失败”
解析'平1.30.200.3 |找到/ I “的数据包:发送” 使用'命令['FOR/F'环](http://ss64.com/nt/for_cmd.html)。 – JosefZ