Task
Execute a system command and get its output into the program. The output may be stored in any kind of collection (array, list, etc.).




Related task
  Execute a system command


Module Module1
 
    Sub Main()
        Dim proccess As New Process
        Dim startInfo As New ProcessStartInfo
 
        startInfo.WindowStyle = ProcessWindowStyle.Hidden
        startInfo.FileName = "cmd.exe"
        startInfo.Arguments = "/c echo Hello World"
        startInfo.RedirectStandardOutput = True
        startInfo.UseShellExecute = False
 
        proccess.StartInfo = startInfo
        proccess.Start()
 
        Dim output = proccess.StandardOutput.ReadToEnd
        Console.WriteLine("Output is {0}", output)
    End Sub
 
End Module