Installing printer with a single script.

I’ll keep it short this time.

Task: Deploy network printer drivers along with the install script to a number of machines.
New local TCP/IP port is required for the printer (if exists – delete and re-create), then copy drivers and install printer.

The batch script bellow will use the set of “Printing Admin Scripts” that you can find on each Windows 7 Pro/Ent/Ultimate as well as Windows 8.1 and Windows 10 under C:\Windows\System32

Now, our printer IP is: 192.168.1.100
Printer name is: Xerox WorkCentre 7435
Location: Office

Remember the varDriver has to be the actual driver name (ie.¬†TOSHIBA Universal Printer 2 or Xerox WorkCentre 7435 as in this particular example). If it won’t match the driver name from the .inf file, you’ll get “error 87 – unable to add printer” and the script won’t work.

you can set varDriverFolder and varDriverFile as network share as well as local hard drive location.

For Altiris users:

Create detection rule as “Registry Key Value” and point it to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\Xerox WorkCentre 7435 with the registry entryPortand registry valueIP_192.168.1.100”¬†