title: How to run a CMD.exe command from an ASP.NET application?
body: <p>Here's my code:</p>
  
  <pre><code>string ex = "java -jar \"" + Settings.ClosureCompilerJarLocation + "\" --js \"" + C2runtimePath + "\" --js_output_file \"" + C2runtimeCompiledPath + "\" --language_in ECMASCRIPT5_STRICT --compilation_level ADVANCED_OPTIMIZATIONS --externs \"" + Settings.C2ExternsFolderLocation + "jquery-externs.js\" --externs \"" + Settings.C2ExternsFolderLocation + "c2-externs.js\"";
  System.Diagnostics.Process.Start("CMD.exe", ex);
  </code></pre>
  
  <p>And an example of <code>ex</code> printed just before it executes:</p>
  
  <blockquote>
    <p>java -jar
    "C:\inetpub\wwwroot\ScirraNew\static\ac\closure-compiler\compiler.jar"
    --js "C:\inetpub\wwwroot\arcade\games\46/c2runtime.js" --js_output_file "C:\inetpub\wwwroot\arcade\games\46/c2runtime_COMPILED.js"
    --language_in ECMASCRIPT5_STRICT --compilation_level ADVANCED_OPTIMIZATIONS --externs
    "C:\inetpub\wwwroot\ScirraNew\static\ac\templates\jquery-externs.js"
    --externs "C:\inetpub\wwwroot\ScirraNew\static\ac\templates\c2-externs.js"</p>
  </blockquote>
  
  <ul>
  <li>It doesn't throw any errors and doesn't complete the command</li>
  <li>If  I copy + paste the command into cmd.exe myself it runs just fine</li>
  </ul>