using System . Diagnostics;
private void button1_Click( object sender , EventArgs e)
{
Process vProcess = new Process ();
vProcess . StartInfo . FileName = "cmd.exe" ;
vProcess . StartInfo . UseShellExecute = false ;
vProcess . StartInfo . RedirectStandardInput = true ;
vProcess . StartInfo . RedirectStandardOutput = true ;
vProcess . StartInfo . RedirectStandardError = true ;
vProcess . StartInfo . CreateNoWindow = false ;
vProcess . Start();
vProcess . StandardInput . WriteLine( @"dir d:\" );
vProcess . StandardInput . WriteLine( "exit" );
textBox1 . Text = vProcess . StandardOutput . ReadToEnd();
vProcess . Close();
}