title: How to execute command-line arguments with parameters in C#?
body: <p>I'm trying to compare two folders using a third party comparison tool called UltraCompare. The following line calls the program and opens two files... but this doesn't do anything except open them, plus it doesn't work properly for <em>folders</em>.</p>
  
  <pre><code>Process.Start("C:\\Program Files\\IDM Computer Solutions\\UltraCompare\\uc.exe", 
  textBoxContents1 + " " + textBoxContents2);
  </code></pre>
  
  <p>I'd like to use the following command line call which opens two folders, runs a comparison on them, and stores the results in output.txt: <strong>uc -d -dmf "c:\dir1" "c:\dir2" -o "c:\output.txt"</strong></p>
  
  <p>Also, I'd need to use variables for the folders instead of hardcoding the paths.</p>
  
  <p>How can I work that into my C# code? </p>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>I've modified my code according to your suggestions:</p>
  
  <pre><code>var p = new System.Diagnostics.Process();
  p.StartInfo.FileName = "C:\\Program Files\\IDM Computer Solutions\\UltraCompare\\uc.exe";
  p.StartInfo.Arguments = String.Format("-d -dmf \"{0}\" \"{1}\" -o c:\\output2.txt",
  textBoxContents1, textBoxContents2);
  p.Start();
  </code></pre>
  
  <p>I'm wondering why the third line containing the arguments still doesn't work...</p>
  
  <p><strong>UPDATE 2:</strong></p>
  
  <p>My mistake. It is working now!! Just doesn't display the folders in UltraCompare but it is still writing and saving the output. Thanks guys!</p>