You can use WMI (add referrence/import to system.manageme nt)
Dim objPing As New SelectQuery("SE LECT StatusCode FROM Win32_PingStatu s
where address='" & machinename_or_ ipaddress & "'")
Dim objSearch as New ManagementObjec tSearcher(objPi ng)
Dim PingStatus As String = ""
For Each objItem as In objSearch.Get()
PingStatus = objItem("Status Code").ToString
Next
if PingStatus <"0" Then
' failed
else
'success
end if
HTH,
Phil
"Robert Dufour" wrote:
Its easy in 2005 but I'm stuck with 2003 for now
>
Can anyone provide a snippet of code?
Thanks for any help.
Bob
>
>
>
\\\
Dim p As New Process
Dim pi As New ProcessStartInf o
pi.UseShellExec ute = False
pi.RedirectStan dardOutput = True
pi.Arguments = "www.google.com "
pi.WorkingDirec tory = "C:\windows\sys tem32"
'this for nt* computers
pi.FileName = "ping"
p.StartInfo = pi
p.StartInfo = pi
p.Start()
Dim sr As IO.StreamReader = p.StandardOutpu t
Dim sb As New System.Text.Str ingBuilder("")
Dim input As Integer = sr.Read
Do Until input = -1
sb.Append(ChrW( input))
input = sr.Read
Loop
MessageBox.Show (sb.ToString)
///
Thank you folks, been a great help.
Bob
"Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
news:epJDIXuMHH A.536@TK2MSFTNG P02.phx.gbl...
You can forever use the application start.
>
\\\
Dim p As New Process
Dim pi As New ProcessStartInf o
pi.UseShellExec ute = False
pi.RedirectStan dardOutput = True
pi.Arguments = "www.google.com "
pi.WorkingDirec tory = "C:\windows\sys tem32"
'this for nt* computers
pi.FileName = "ping"
p.StartInfo = pi
p.StartInfo = pi
p.Start()
Dim sr As IO.StreamReader = p.StandardOutpu t
Dim sb As New System.Text.Str ingBuilder("")
Dim input As Integer = sr.Read
Do Until input = -1
sb.Append(ChrW( input))
input = sr.Read
Loop
MessageBox.Show (sb.ToString)
///
>
Cor
>
Comment