How to automate the installation and configuration of a local printer

automationprinterwindows-xp

I'm running Windows XP SP3.
I have a fleet of laptop computers that I'm creating a master clone for.
Each of these computers will have a different function when deployed so I've created a series of batch files to configure their shortcuts and other settings.

One thing I haven't figured out how to do is automate a local printer install via USB. I can do it with a network printer, but none of these will be using network printers.

How do I automate the installation and configuration of a local printer?

Best Answer

The arcane rundll32 printui.dll PrintUIEntry is supposed to handle that as well - it can install local drivers and printers with its various options.

From the help:

Add printer driver using inf:

rundll32 printui.dll,PrintUIEntry /ia /c\\machine /m "Apollo P-1200" /h "x86" /v "Type 3 - User Mode" /f C:\InfPath\InfFile.inf

Usually, you need not do more than that - as soon as the driver is present in the system, connecting and using a USB printer should be plug & play as Zoredache has noticed.

If your users do have administrative privileges, things would get even easier as you just could drop the driver files in a directory which you merely would need to include in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\DevicePath - this directory gets searched for drivers whenever a new device is detected and the logged on user has the privilege to install/load drivers. But also note that let users work with administrative privileges is strongly discouraged for various reasons.