How to execute commands in Command Prompt using c#
<p>I want to execute these steps in CMD using c#</p>

<p>1 - CD C:\MySQL\MySQL Server 5.0\bin</p>

<p>2 - mysqldump -uroot -ppassword sample> d:\Test\222.sql</p>

<p>On manually doing this, i will get file named "222.sql"</p>

<p>I am using the below code to do it, but missing something.. Nothing Happens</p>

<pre><code>public void CreateScript_AAR()
    {
        string commandLine = @"CD C:\MySQL\MySQL Server 5.0\bin\mysqldump -uroot -ppassword sample&gt; d:\Test\222.sql""";
        System.Diagnostics.ProcessStartInfo PSI = new System.Diagnostics.ProcessStartInfo("cmd.exe");
        PSI.RedirectStandardInput = true;
        PSI.RedirectStandardOutput = true;
        PSI.RedirectStandardError = true;
        PSI.UseShellExecute = false;
        System.Diagnostics.Process p = System.Diagnostics.Process.Start(PSI);
        System.IO.StreamWriter SW = p.StandardInput;
        System.IO.StreamReader SR = p.StandardOutput;
        SW.WriteLine(commandLine);
        SW.Close();
    } 
</code></pre>
