Search This Blog

Thursday, December 26, 2013

Install Printer driver

Some times I need to install a printer driver silently, this could for example be in a SCCM Task Sequence.

One way around this is to use the build-in tools in C:\Windows\System32\Printing_Admin_Scripts

Lets try to install the HP Universal Printer Driver this way, by using the command:

cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "HP Universal Printing PCL 6 (v5.7.0)" -i "C:\drv\hpcu155u.inf"

image

After this the driver is installed as shown in the Print Server Properties.

image

See more information regarding prndrvr.vbs here http://technet.microsoft.com/en-us/library/cc754632.aspx

We can use another script, prnmngr.vbs to install a printer.

With this command we install a printer called temp pointing to LPT1 and using the driver we just installed:

cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -a -p "temp" -m "HP Universal Printing PCL 6 (v5.7.0)" -r "lpt1:"

image

The printer is installed as shown in Devices and Printers:

image

Se more information regarding prnmngr.vbs herehttp://technet.microsoft.com/en-us/library/cc725868.aspx

Installing the printer will also generate the “famous”  BUD file that sometimes is cursing printing problems. As an example problems with the BUD file can lead to very slow printer dialog boxes.

The .BUD file is a binary printer description file that is used to increase spooler efficiency for printer drivers.

Now lets delete the printer again with the command:

cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "temp"

image

And finally we delete the Printer driver with the command:

cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -d -m "HP Universal Printing PCL 6 (v5.7.0)" -e "Windows x64" -v 3

image

This is just examples on how to use some of the printing tools, there are lots of possibilities and even more tools, so take a closer look at the tools when your need to automate printers.

image

No comments:

Post a Comment