c# - How to run a specific DOS Command
<p>I tried various methods possible to run this specific DOS command thru C#. I do not want to use a batch file. Whatever i try, it keeps taking only first word from Printer name and not the entire name, in this case, it says Printer POS is not connected instead of saying Printer POS Lexmark is not connected. What could the error be? Thanks guys!</p>

<p>The DOS command is : rundll32 printui, PrintUIEntry /o /n "POS Lexmark"</p>

<p>My code is as follows: </p>

<pre><code>string command = string.Format("/c rundll32 printui, PrintUIEntry /o /n" + " POS Lexmark"); 
ProcessStartInfo cmdsi = new ProcessStartInfo("cmd.exe");
cmdsi.Arguments = command;
cmdsi.CreateNoWindow = false;
Process cmd = Process.Start(cmdsi); 
</code></pre>
