lparameters tcTarget, tlVerbose local loWMI, loPingResults, loPingResult, lcTarget if Vartype(tcTarget) # 'C' if tlVerbose wait window 'Invalid Target' timeout 10 endif return .f. endif lcTarget = Alltrim(tcTarget) loWMI = GetObject("winmgmts:") loPingResults = loWMI.ExecQuery("SELECT * FROM Win32_PingStatus WHERE Address = '" + lcTarget + "' and ResolveAddressNames=TRUE") For Each loPingResult In loPingResults with loPingResult if tlVerbose If .StatusCode = 0 If Lower(lcTarget) = .ProtocolAddress ? lcTarget + " is responding" Else ? lcTarget + "(" + .ProtocolAddress + ") is responding" EndIf ? "Bytes = ", .BufferSize ? "Time (ms) = ", .ResponseTime ? "TTL (s) = ", .ResponseTimeToLive ? "Resolve Address Names? = ", .ResolveAddressNames Else ? lcTarget + " is not responding" ? "Status code is ", .StatusCode endif ? '' EndIf return Iif(Isnull(loPingResult.StatusCode), .f., loPingResult.StatusCode = 0) endwith Next return .f.