Re: Ping using VBS w/o active window
- From: "de Graff" <rjdegraff@xxxxxxx>
- Date: Thu, 31 Mar 2005 18:51:11 -0600
Or you could bypass the run command altogether by using WMI
Function WMIPing(strSrv)
'function returns TRUE if successful contact was made.
On Error Resume Next
Dim oWMI,oRef
Const ReturnImmediately=&h10
Const ForwardOnly=&h20
strQuery="Select CSName,Status FROM Win32_OperatingSystem"
Set oWMI=GetObject("Winmgmts://"&strSrv)
If Err.Number Then
WMIPing=False
Exit Function
End If
Set oRef=oWMI.ExecQuery(strQuery,"WQL",ForwardOnly+ReturnImmediately)
If Err.Number Then
WMIPing=False
Exit Function
End If
for each item in oRef
If item.Status="OK" Then
WMIPing=True
Else
WMIPing=False
End If
Next
End Function
.
- Follow-Ups:
- Re: Ping using VBS w/o active window
- From: caglaror
- Re: Ping using VBS w/o active window
- References:
- Ping using VBS w/o active window
- From: Jeff
- Ping using VBS w/o active window
- Prev by Date: detect user leaving site or closing browser window
- Next by Date: Re: How do I use an array inside a dictionary (as key)?
- Previous by thread: Re: Ping using VBS w/o active window
- Next by thread: Re: Ping using VBS w/o active window
- Index(es):
Relevant Pages
|