26/09/2011, 10:49
|
| | Fecha de Ingreso: diciembre-2008
Mensajes: 84
Antigüedad: 15 años, 11 meses Puntos: 0 | |
Respuesta: Detectar perdida de conexion de Red Encontre este codigo:
<script language="VBScript" type="text/vbscript" >
Host="nemesis"
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonat e}")._
ExecQuery("Select * from Win32_PingStatus Where Address = '" & Host & "'")
For Each objStatus in objPing
strResult = "" & "Result: "
Select Case objStatus.StatusCode
Case 0 strResult = strResult & "Success"
Case 11001 strResult = strResult & "Buffer too small"
Case 11002 strResult = strResult & "Destination net unreachable"
Case 11003 strResult = strResult & "Destination host unreachable"
Case 11004 strResult = strResult & "Destination protocol unreachable"
Case 11005 strResult = strResult & "Destination port unreachable"
Case 11006 strResult = strResult & "No resources"
Case 11007 strResult = strResult & "Bad option"
Case 11008 strResult = strResult & "Hardware error"
Case 11009 strResult = strResult & "Packet too big"
Case 11010 strResult = strResult & "Request timed out"
Case 11011 strResult = strResult & "Bad request"
Case 11012 strResult = strResult & "Bad route"
Case 11013 strResult = strResult & "Time-To-Live (TTL) expired transit"
Case 11014 strResult = strResult & "Time-To-Live (TTL) expired reassembly"
Case 11015 strResult = strResult & "Parameter problem"
Case 11016 strResult = strResult & "Source quench"
Case 11017 strResult = strResult & "Option too big"
Case 11018 strResult = strResult & "Bad destination"
Case 11032 strResult = strResult & "Negotiating IPSEC"
Case 11050 strResult = strResult & "General failure"
Case Else strResult = strResult & "Unknown host"
End Select
strResult = strResult & " Host : " & UCase(Host)
Next
msgbox strResult
Set objPing = Nothing
</script>
Lo probe y funciona. |