比如,要判断 www.baidu.com/img/baidu_logo.gif 是否有效或存在,变一下slore兄的代码,总是提示不通。
不知这个举一反三是不是用错了,请指教,多谢!
HOST = "."
TARGET = "www.baidu.com/img/baidu_logo.gif"
Set PingResults = GetObject("winmgmts:{impersonationLevel=impersonate}//" & _
HOST & "/root/cimv2"). ExecQuery("SELECT * FROM Win32_PingStatus " & _
"WHERE Address = '" + TARGET + "'")
For Each PingResult In PingResults
If PingResult.StatusCode = 0 Then
WScript.Echo "通"
Else
WScript.Echo "不通"
End If
Next
不知这个举一反三是不是用错了,请指教,多谢!
HOST = "."
TARGET = "www.baidu.com/img/baidu_logo.gif"
Set PingResults = GetObject("winmgmts:{impersonationLevel=impersonate}//" & _
HOST & "/root/cimv2"). ExecQuery("SELECT * FROM Win32_PingStatus " & _
"WHERE Address = '" + TARGET + "'")
For Each PingResult In PingResults
If PingResult.StatusCode = 0 Then
WScript.Echo "通"
Else
WScript.Echo "不通"
End If
Next
