title: Launch a command prompt with parameters
body: <p>I need to launch a command from the prompt with parameters within my WPF C# application to synchronize two databases.</p>
  
  <p>The command in the file.bat is as follows:</p>
  
  <pre><code>"c:\Program Files\Microsoft SQL Server\100\COM\replmerg.exe" -Publisher [sql2008-srv\sql2008srv] -PublisherDB [MIODB] -Publication [DBPublication] -Subscriber [UTENTE\SQL2008R2EXP] -SubscriberDB [MIODB] -SubscriptionType 1 -SubscriberSecurityMode 1 -Distributor [sql2008-srv\sql2008srv] -OutputVerboseLevel 4 -Output C:\Windows\Temp\mergeagent.log 
  </code></pre>
  
  <p>Below my code but does not run. Just open the shell with the flashing cursor:</p>
  
  <pre><code>string ciao = "\"c:\\Program Files\\Microsoft SQL Server\\100\\COM\\replmerg.exe\" -Publisher [sql2008-srv\\sql2008srv] -PublisherDB [DataNavi] -Publication [DataNaviPublication] -Subscriber [SFRANCESCO\\SQL2008R2EXP] -SubscriberDB [DataNavi] -SubscriptionType 1 -SubscriberSecurityMode 1 -Distributor [sql2008-srv\\sql2008srv] -OutputVerboseLevel 4 -Output C:\\Windows\\Temp\\mergeagent.log ";
  
  try
  {
      Process.Start("CMD.exe", "/K" +ciao);
  }
  catch (Exception ex)    
  {        
      // Implement appropriate error handling here.
      MessageBox.Show("errore:" + ex.Message, "Errore sincronizzazione");
  }
  </code></pre>