' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System.Diagnostics

Public Partial Class MainForm
    Public Sub New()
        Me.InitializeComponent()
    End Sub
    Sub Button1Click(sender As Object, e As System.EventArgs)
        Dim pi As ProcessStartInfo = New ProcessStartInfo
        pi.FileName = "cmd"
        pi.Arguments = "/c dir C:\"
        pi.UseShellExecute = False
        pi.RedirectStandardOutput = True
        Dim p As Process = Process.Start(pi)
        textBox1.Text = p.StandardOutput.ReadToEnd
    End Sub
End Class
