echo "ping baidu..." ping www.baidu.com >>1.txt echo "ping sina..." ping www.sina.com >>1.txt echo "finished,please look 1.txt for more information!" pause 把上面这段保存为cmd文件,然后运行,会产生1.txt,在1.txt中会有类似如下的内容:Pinging www.a.shifen.com [220.181.6.18] with 32 bytes of data:Reply from 220.181.6.18: bytes=32 time=25ms TTL=55Reply from 220.181.6.18: bytes=32 time=25ms TTL=55Reply from 220.181.6.18: bytes=32 time=27ms TTL=55Reply from 220.181.6.18: bytes=32 time=27ms TTL=55Ping statistics for 220.181.6.18: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: Minimum = 25ms, Maximum = 27ms, Average = 26ms baidu的响应时间 Pinging newsnj.sina.com.cn [202.102.75.167] with 32 bytes of data:Reply from 202.102.75.167: bytes=32 time=11ms TTL=56Reply from 202.102.75.167: bytes=32 time=6ms TTL=56Reply from 202.102.75.167: bytes=32 time=11ms TTL=56Reply from 202.102.75.167: bytes=32 time=5ms TTL=56Ping statistics for 202.102.75.167: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: Minimum = 5ms, Maximum = 11ms, Average = 8ms sina的响应时间
ping www.sina.com >>1.txt然后查看一下那个快就好了!
ping www.baidu.com >>1.txt
echo "ping sina..."
ping www.sina.com >>1.txt
echo "finished,please look 1.txt for more information!"
pause
把上面这段保存为cmd文件,然后运行,会产生1.txt,在1.txt中会有类似如下的内容:Pinging www.a.shifen.com [220.181.6.18] with 32 bytes of data:Reply from 220.181.6.18: bytes=32 time=25ms TTL=55Reply from 220.181.6.18: bytes=32 time=25ms TTL=55Reply from 220.181.6.18: bytes=32 time=27ms TTL=55Reply from 220.181.6.18: bytes=32 time=27ms TTL=55Ping statistics for 220.181.6.18: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: Minimum = 25ms, Maximum = 27ms, Average = 26ms baidu的响应时间 Pinging newsnj.sina.com.cn [202.102.75.167] with 32 bytes of data:Reply from 202.102.75.167: bytes=32 time=11ms TTL=56Reply from 202.102.75.167: bytes=32 time=6ms TTL=56Reply from 202.102.75.167: bytes=32 time=11ms TTL=56Reply from 202.102.75.167: bytes=32 time=5ms TTL=56Ping statistics for 202.102.75.167: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: Minimum = 5ms, Maximum = 11ms, Average = 8ms sina的响应时间