Install printer programmatically

  • Thread starter Francesco Chialetto
  • Start date
F

Francesco Chialetto

I'm trying to install a printer driver using this code:

Process p = new Process();

ProcessStartInfo pSI = new ProcessStartInfo("rundll32");

pSI.UseShellExecute = false;


p.StartInfo = pSI;

p.StartInfo.Arguments = "printui.dll,PrintUIEntry /ia /m \"Epson EPL-5700\"
/h \"Intel\" /v \"Windows 2000 or XP\" /f \"%windir%\\inf\\ntprint.inf\"
/u";

p.Start();

p.WaitForExit();



After execution a pop up appear which says: "The arguments are invalid". If
i run the command in console it works. Do you have any idea on why it
happens or any suggestion to do the same stuff using a different method?

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top