我想編寫一個批處理文件來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