<p>Voici tout ce que vous avez a faire pour executer des commandes shell depuis C#</p>
<pre><code class="lang-auto">string strCmdText;
strCmdText= "/C copy /b Image1.jpg + Archive.rar Image2.jpg";
System.Diagnostics.Process.Start("CMD.exe",strCmdText);
</code></pre>
<p><strong>EDIT :</strong></p>
<p>Ceci permet de masquer la fenetre cmd.</p>
<pre><code class="lang-auto">System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/C copy /b Image1.jpg + Archive.rar Image2.jpg";
process.StartInfo = startInfo;
process.Start();
</code></pre>
<p><strong>EDIT 2 :</strong></p>
<p>Il est important que l’argument commence par <code>/C</code>, sinon cela ne fonctionnera pas. Comme l’a dit <a href="https://stackoverflow.com/users/5007/scott-ferguson">@scott-ferguson</a> : <em>/C execute la commande specifiee par la chaine puis se termine</em>.</p>