帮忙写个小批处理

来源:百度知道 编辑:UC知道 时间:2024/06/14 15:19:39
大致的内容是,ping某域名,获取其ip,然后截取IP地址,以记事本输出。谢谢

ping www.baidu.com >2.txt
会在当前目录下生成一个记事本2.txt,内容为

Pinging www.baidu.com [220.181.37.55] with 32 bytes of data:

Reply from 220.181.37.55: bytes=32 time=46ms TTL=53

Reply from 220.181.37.55: bytes=32 time=45ms TTL=53

Reply from 220.181.37.55: bytes=32 time=45ms TTL=53

Reply from 220.181.37.55: bytes=32 time=45ms TTL=53

Ping statistics for 220.181.37.55:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 45ms, Maximum = 46ms, Average = 45ms