C# Executing external process with spaces in path on Windows 8
<p>I have a problem starting a process in C# when there's a space in the path on Windows 8, <em>even when the path is in double quotes!</em></p>

<p>The following code has been working fine for years on our XP and Windows 7 machines, but we recently switched some development boxes over to Windows 8 and we now get the following error:</p>

<p><code>'D:\Workspace\Visual' is not recognized as an internal or external command, operable program or batch file.</code></p>

<p>Code:</p>

<pre><code>string command = "\"D:\\Workspace\\Visual Studio 2010\\Dev\\Tools\\Editors\\AssetManager\\bin\\Tools\\TextureAtlasBuilder.exe\"";
string arguments = "\"D:\\Local\\Temp\\xu2twc4d.cg1\" \"environment-textures\"";

ProcessStartInfo startInfo = new ProcessStartInfo
{
    CreateNoWindow = true,
    UseShellExecute = false,
    WindowStyle = ProcessWindowStyle.Hidden,
    RedirectStandardError = true,
    RedirectStandardOutput = true,
    FileName = string.Format(CultureInfo.InvariantCulture, @"{0}\cmd.exe", Environment.SystemDirectory),
    Arguments = string.Format(CultureInfo.InvariantCulture, "/C {0} {1}", command, arguments)
};

Process process = new Process
{
    StartInfo = startInfo
};

process.OutputDataReceived += new DataReceivedEventHandler(StandardOutputHandler);
process.ErrorDataReceived += new DataReceivedEventHandler(StandardErrorHandler);

process.Start();
</code></pre>

<p>I've tried literal strings with and without double quotes, verbatim strings with and without double quotes, and I always get the same error!</p>

<p>What am I doing wrong?!</p>

<p>Thanks</p>
