windows下有没有定时ping某个ip的命令
用ping -t xxx的话,频率太快,有没有每60秒ping一次,终止后显示百分比的命令
写一个bat用循环 pinginfoview https://www.elifulkerson.com/projects/tcping.php
但是不能icmp,只能tcp+端口
tcping -t -i 3 www.baidu.com
** Pinging continuously.Press control-c to stop **
Probing 163.177.151.110:80/tcp - Port is open - time=41.566ms
Probing 163.177.151.110:80/tcp - Port is open - time=43.753ms
Control-C
Ping statistics for 163.177.151.110:80
2 probes sent.
2 successful, 0 failed.(0.00% fail)
Approximate trip times in milli-seconds:
Minimum = 41.566ms, Maximum = 43.753ms, Average = 42.660ms 如果只想用windows自身组件实现
写个后台运行的bat,ping的参数设置好,并且持续写入指定文件。
自己搜一下,几行代码的事。
然后windows自带计划任务,设定好时间和触发器即可。 装个 WSL, 用 Linux 下的 ping, 支持 -i 参数 litel 发表于 2022-8-25 13:35
https://www.elifulkerson.com/projects/tcping.php
但是不能icmp,只能tcp+端口
感谢大佬,这个好用,其实我电脑上有tcping,但是原来不知道可以加 i 参数。
bat写入结果到TXT,然后用计划任务run PowerShell的
如果有次数限制,可以用这个(以5次为例):
$Results = Test-Connection -TargetName "baidu.com" -Delay 60 -Count 5
如果要不断循环,可以用这个
Test-Connection -TargetName "baidu.com" -Delay 60 -Repeat | ForEach-Object -Begin { $Results = @() } -Process { $Results += $_ }什么时候不测了就按Ctrl+C中断。
最后跑这个算百分比:
$Results.Status.Where({$_ -eq 'Success'}).Count / $Results.Count 如果能用第三方软件的话 有一个老软件叫ATKKPING 你要的功能都有
页:
[1]