running cmd from visual studio 2008 /c#
<p>I am new to c# and am trying to run a cmd line utility called mediainfo from a c# script. I am trying to redirect the execution results output to a text file (file1out.txt) and when running straight from the cmd console the following works: 
<code>C:\programs\mediainfo_cli\mediainfo.exe --Inform=file://C:\temp\template.txt "C:\temp\3gp\file1.3gp" &gt; c:\temp\3gp\file1out.txt</code></p>

<p>However, from the script it doesn't work.</p>

<pre><code>    private void button1_Click(object sender, EventArgs e)
    {
        LaunchCommandLineApp();
    }

    static void LaunchCommandLineApp()
    {
        // Use ProcessStartInfo class
        ProcessStartInfo startInfo = new ProcessStartInfo();

        string strArg = @" --Inform=file://C:\temp\template.txt C:\temp\3gp\file1.3gp &gt; C:\temp\3gp\file1out.txt";

        //startInfo.FileName = "calc.exe";
        startInfo.FileName = "C:\\Programs\\mediainfo_cli\\mediainfo.exe";
        startInfo.Arguments = strArg;
        startInfo.UseShellExecute = false;
        startInfo.RedirectStandardOutput = true;

        try
        {
            using (Process exeProcess = Process.Start(startInfo))
            {
                exeProcess.WaitForExit();
            }
        }

        catch
             {
                MessageBox.Show("Error");
             }
        }
</code></pre>
