Install printer programmatically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Francesco Chialetto

    Install printer programmatically

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

    Process p = new Process();

    ProcessStartInf o pSI = new ProcessStartInf o("rundll32") ;

    pSI.UseShellExe cute = false;


    p.StartInfo = pSI;

    p.StartInfo.Arg uments = "printui.dll,Pr intUIEntry /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


Working...