準備
(なし)
デザイン
1. フォーム (Form1) にボタン (button1) を配置します。
2. フォーム (Form1) にリストボックス (listBox1) を配置します。
サンプルコード (C#)
//名前空間の追加
using System.Diagnostics;
using System.IO;
// コード
private void button1_Click(object sender, EventArgs e)
{
Process ps = new Process();
StreamReader sr;
ps.StartInfo.FileName = "cmd";
ps.StartInfo.Arguments = @"/A /C dir C:\Windows\System32\Drivers";
ps.StartInfo.RedirectStandardOutput = true;
ps.StartInfo.UseShellExecute = false;
ps.StartInfo.CreateNoWindow = true;
ps.Start();
ps.WaitForExit();
sr = ps.StandardOutput;
while (sr.Peek() > -1)
{
Console.WriteLine(sr.ReadLine());
}
}
解説
Process で実行した結果を一度、標準出力に書き込みます。そして、StreamReader により、その出力を読み込みます。
結果

動作確認環境
Visual Studio 2015 Professional (C# 6.0)