Dim proc As New Process
Try
proc.StartInfo.FileName = "cmd.exe"
proc.StartInfo.UseShellExecute = False
proc.StartInfo.RedirectStandardInput = True
proc.StartInfo.RedirectStandardOutput = True
proc.StartInfo.RedirectStandardError = True
proc.StartInfo.CreateNoWindow = True
proc.Start()
Dim dosLine As String = "ping -n 1 192.168.0.9"
proc.StandardInput.WriteLine(dosLine)
proc.StandardInput.WriteLine("exit")
While (Not proc.HasExited)
proc.WaitForExit(500)
End While
Dim pingResult As String = proc.StandardOutput.ReadToEnd()
If pingResult <> "" Then
End If
proc.StandardOutput.Close()
Catch ex As Exception
Finally
Try
proc.Close()
proc.Dispose()
Catch ex As Exception
End Try
End Try