How to read cmd?

Posts 1–3 of 3 · Page 1 of 1
How to read cmd?
Hey I want to execute a command in cmd, and after it I want to read the output.
The command is "netstat -o".

I hope anyone can help me.
Code:
Dim oProcess As New Process()
Dim oStartInfo As New ProcessStartInfo("ApplicationName.exe", "arguments")
oStartInfo.UseShellExecute = False
oStartInfo.RedirectStandardOutput = True
oProcess.StartInfo = oStartInfo
oProcess.Start()

Dim sOutput As String
Using oStreamReader As System****.StreamReader = oProcess.StandardOutput
    sOutput = oStreamReader.ReadToEnd()
End Using
Console.WriteLine(sOutput)
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us