WMI中的Win32_PingStatus类(ping命令实现)
程序员文章站
2022-04-10 08:10:45
复制代码 代码如下: ip = "jb51.net" wql = "select * from win32_pingstatus where address = '$ip'...
复制代码 代码如下:
ip = "jb51.net"
wql = "select * from win32_pingstatus where address = '$ip'"
wql = replace(wql,"$ip",ip)
n = 0 : s = 0
do until n = 100
set objwmiservice = getobject("winmgmts:\\.\root\cimv2")
set colitems = objwmiservice.execquery(wql,,48)
for each objitem in colitems
if objitem.statuscode = 0 then
s = s + objitem.responsetime
n = n + 1
end if
next
loop
wscript.echo "average:" & s / n
参考链接:win32_pingstatus class
原文:
上一篇: PHP判断两个给定日期是否在同一周的方法
下一篇: 运行同一目录下的可执行程序的VBS代码