- WSH.Sleep 1000 * 60 * 5
- If Ping("www.xxx.cn") Then
- OpenIE("www.xxx.cn/index.html")
- End If
-
-
- Sub OpenIE(strWeb)
- CreateObject("WScript.Shell").Run "iexplore " + strWeb
- End Sub
-
- Function Ping(strHost)
- b = False
- strComputer = strHost
- Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
- Set colItems = objWMIService.ExecQuery _
- ("Select * from Win32_PingStatus " & _
- "Where Address = '" & strComputer & "'")
- For Each objItem in colItems
- If objItem.StatusCode = 0 Then
- b = True
- Exit For
- End If
- Next
- Ping = b
- End Function
复制代码
|