vbs ping实现的两种方式(vbs简单命令)真没想到

随心笔谈11个月前发布 admin
96 0


‘url=”www.baidu.com”
url=”119.75.217.109″
strComputer=”.”
Set objWMIService=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & strComputer & “\root\cimv2”)
Set colPings=objWMIService.ExecQuery (“Select * From Win32_PingStatus where Address='” & url & “‘”)
For Each objPing in colPings
MsgBox url & ” responded to ping.” & vbcrlf &_
“Responding Address: ” & objPing.ProtocolAddress & vbcrlf &_
“Responding Name: ” & objPing.ProtocolAddressResolved & vbcrlf &_
“Bytes Sent: ” & objPing.BufferSize & vbcrlf &_
“Time: ” & objPing.ResponseTime & ” ms”
Next

© 版权声明

相关文章