Personally I would choose either method two or three, although the third method does have a slight advantage in that you do not have to depend on any external files (rundll32 or the various VBScripts included with Windows) - not sure if that matters though? Since you cannot create TCP/IP printer ports via printui.dll, you might as well do everything via WMI to keep things simple.

Originally Posted by
mac_shinobi
I was contemplating using the rundll method but then I would require some method of being able to read the inf file that is included in the driver for the printer to be installed which will vary depending on manufacturer and model of printer / copier etc.
All three of the methods listed above would still require you to know the printer(s) model from the INF. Here are some examples...
Code:
[RICOH]
"RICOH Aficio MP C2000 PCL 5c" = RIC53D,USBPRINT\RICOHAficio_MP_C20000769,LPTENUM\RICOHAficio_MP_C20000769,RICOHAficio_MP_C20000769,RICOHAficio_MP_C2000_769
"RICOH Aficio MP C2500 PCL 5c" = RIC53D,USBPRINT\RICOHAficio_MP_C25000679,LPTENUM\RICOHAficio_MP_C25000679,RICOHAficio_MP_C25000679,RICOHAficio_MP_C2500_679
"RICOH Aficio MP C3000 PCL 5c" = RIC53D,USBPRINT\RICOHAficio_MP_C3000FB68,LPTENUM\RICOHAficio_MP_C3000FB68,RICOHAficio_MP_C3000FB68
Code:
[DELL]
"Dell Laser Printer 5100cn PCL6"=DLXCRZP,LPTENUM\DellLaser_Printer_51234F
"Dell Laser Printer 5100cn PCL6"=DLXCRZP,USBPRINT\DellLaser_Printer_51234F
Code:
[Strings]
HP_Mombi_Driver_Name ="HP LaserJet P2015 Series PCL 6"
[HP]
%HP_Mombi_Driver_Name%=LJ_P2015,USBPRINT\Hewlett-PackardHP_LaF552
%HP_Mombi_Driver_Name%=LJ_P2015,USBPRINT\Vid_03f0&Pid_3817
The bit you need to look for is the text shown in bold. When it comes to installing a driver which is for more than one model, you would just specify the name of each model individually.