Spawning command prompt app in CMD window in C#
<p>I need to run a legacy app that is run from a cmd window using the Process class.</p>

<pre><code>ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/C \"C:\\MySys\\My2Com.exe –r " + Parameters.FullPath;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;

try
{
    // Start the process with the info we specified.
    // Call WaitForExit and then the using statement will close.
    using (Process exeProcess = Process.Start(startInfo))
    {
        exeProcess.WaitForExit();
    }
}
catch (Exception e)
{
    string sMsg = "Error copying the files to " + Parameters.FullPath + ".";
    HandleErrorMsg(e, sMsg);
    return;
}
</code></pre>

<p>The process My2Com.exe should run in the background, however, I consistantly get the message that a file, used when run from the cmd line with different flags, is missing.  If I run the command as indicated in a cmd window, C:\MySys\My2Com.exe –r FullyQualPath, it works as expected. I have tried several different ways to set up the Process class without success.</p>

<p>Any suggestions would be appreciated.</p>

<p>Thank you.</p>
