title: Problems launching a process with Process.Start() - how do I construct the argument list?
body: <p>I've got this:</p>
  
  <pre><code>string cmd = " -i """ + finPath + """ -ar 44100 -ab 160k """ + foutPath + """";
  </code></pre>
  
  <p>and I need to pass it to command prompt from C# using <code>Systems.Diagnostics.Process</code>.</p>
  
  <p>No combination seems to work. Program works just fine if I run it in command prompt.
  Also runs just fine if I use the same string in VB.Net</p>
  
  <p><code>finPath</code> has spaces as does <code>foutPath</code> and it's making the program not run.</p>
  
  <p>I need to have <code>finPath</code> expressed as <code>finPath</code>. Same with <code>foutPath</code>.</p>
  
  <hr>
  
  <p>More of the code (used the line suggested here, no luck):</p>
  
  <pre><code>string inputPath = RootPath + "videoinput\\";  
  
  string ffmpegpath = RootPath + "ffmpeg.exe"; //ffmpeg path
  
  string outputPath = RootPath +"videooutput\\"; 
  
  //define new extension
  
  string fileext = ".flv";
  
  string newfilename = namenoextension + fileext;
  
  string namenoextension = Path.GetFileNameWithoutExtension(savedfile);
  
  string fileoutPath = outputPath + newfilename;
  
  string fileinPath = "/videoinput/" + savedfile;
  
  string cmd = " -i \"" + fileinPath + "\" -ar 44100 -ab 160k \"" + fileoutPath + "\"";
  
  
  //Begin encoding process
  
  Process proc = new Process();
  
  proc.StartInfo.FileName = ffmpegpath;
  
  proc.StartInfo.Arguments = cmd;
  
  proc.StartInfo.UseShellExecute = true;
  
  proc.StartInfo.CreateNoWindow = false;
  
  proc.StartInfo.RedirectStandardOutput = false;
  
  proc.Start();
  </code></pre>