I wouldnt usually post a snippet that is just a wrapped one line Powershell command, but I've used it more than once now, you may too.
msgbox(0, '' , _TestConnection())
Func _TestConnection($sComp = "")
$iPid = run('powershell Test-NetConnection ' & $sComp & ' -InformationLevel Quiet' , @WindowsDir , @SW_HIDE , 0x2)
$sOutput = ""
While 1
$sOutput &= StdoutRead($iPID)
If @error Then
ExitLoop
EndIf
WEnd
$bRtn = stringstripws($sOutput , 8) = "True" ? 1 : 0
return $bRtn
EndFunc