ник: osmor
Public Function MyPing(strMachine As String) As Boolean
'вернет True при нормальном пинге
' пример использования MyPing ("www.ya.ru")
Dim objPing As Object
Dim objStatus As Object
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("select * from Win32_PingStatus where address = '" & strMachine & "'")
For Each objStatus In objPing
If IsNull(objStatus.StatusCode) Or objStatus.StatusCode <> 0 Then
MyPing = False
Else
MyPing = True
End If
Next
End Function