批处理的ping 命令怎么用?

2024-11-01 05:37:00
推荐回答(5个)
回答(1):

因为PING一个包大概要1秒呀,所以就用来作延时了,虽然这个方法笨死了。
ping www.163.com 这样,就是拼网易的主页,默认会拼四个包。
ping 127.1 就是拼本机了
加 /n 就是指定拼的包的个数。如
ping /n 5 127.1
这就是拼5个包,就不是默认的四个了。这样就大延时5秒吧。其实这要看网卡了。还有网络状态。一点都不准。

ping /n 5 127.1 >nul 就是把拼的输出信息屏蔽,也就是屏幕上不显示拼的结果,反正我们要延时,不是想知道拼的结果。

ping 本来就作用是来测试网络是否通畅的。如果你拼 163,拼不通,就说明你上不了网易的网站了。

以下是参考:

C:\Users\feng>ping /?

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name

Options:
-t Ping the specified host until stopped.
To see statistics and continue - type Control-Break;
To stop - type Control-C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don't Fragment flag in packet (IPv4-only).
-i TTL Time To Live.
-v TOS Type Of Service (IPv4-only).
-r count Record route for count hops (IPv4-only).
-s count Timestamp for count hops (IPv4-only).
-j host-list Loose source route along host-list (IPv4-only).
-k host-list Strict source route along host-list (IPv4-only).
-w timeout Timeout in milliseconds to wait for each reply.
-R Use routing header to test reverse route also (IPv6-only).
-S srcaddr Source address to use (IPv6-only).
-4 Force using IPv4.
-6 Force using IPv6.

回答(2):

:: 你可以参考以下演示代码,其中-n是ping的次数,一次相当于1秒, 127.1就是127.0.0.1就是本地机的IP ,>NUL是不回显此命令

@echo off
echo 10秒后将自动关闭此窗口
ping -n 10 127.1>nul
exit

回答(3):

....开始....运行....输入..cmd....
然后...ping空格 加IP地址就可以了.....

回答(4):

ping ip -t

回答(5):

ping.192.168.1-t是查看能不能上去网在开始的运行里输上就行