Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

TCP/IP Printer Installs - My Scripts

This has been a question I've seen many times and I've seen a few articles on this.  I wanted to share my scripts that I'm using to hopefully help some others out. 

First - Using PDQ Deploy I used the File Copy and deployed the folder with ALL my companies print drivers. We use Konica Minolta as a reference. So my Folder is located C:\Koinca Minolta\   under that I have 4 other folders that are specific to each printer.   

Second - Create a  .BAT file with the following and add this in PDQ under a CMD Step - Attach Batch Script. 

WMIC PRINTER where PortName="IPADDRESS" delete

WMIC PRINTER where PortName="IPADDRESS_1" delete

cscript %WINDIR%\system32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r "IP_IPADDRESS" -h IPADDRESS -o raw -n 9100

Cscript %WINDIR%\system32\Printing_Admin_Scripts\en-US\prndrvr.vbs -a -m "NAME FROM INF FILE" -i "FULL PATH WITH INF FILE" -h "FULL PATH TO DRIVER FOLDER"

Cscript %WINDIR%\system32\Printing_Admin_Scripts\en-US\Prnmngr.vbs -a -p "PRINTERNAME" -m "KONICA MINOLTA C364SeriesPCL" -r IP_IPADDRESS

Third Step - I created a Separate CMD step and added the following. This will make the printer you just created the Default Printer.  I put it a separate step because I had the best luck running it separate. If I put in the first bat file it wouldn't actually assign as the default.  I'm guessing if you could put a few pause steps in it that would work, but it was just as easy to make it's own step.

Cscript %WINDIR%\system32\Printing_Admin_Scripts\en-US\prnmngr.vbs -t -p "PRINTERNAME"

 

Any questions let me know. 

1

Comments

2 comments
Date Votes
  • See I set up a method for doing our printer drivers as well, but before we had PDQ Deploy under our arsenal. It involves using only the vbs printing scripts, no WMIC required. I just have our drivers on a network share that can be used by our set up account. I actually have two different versions of the batch that I scripted, one for CLI use and the other for an interactive installation. We have at most 10 printers to install at once, or at the least 2. I can give you an empty version of the scripts if you would like, though I'm thinking about switching to Powershell for it instead.

    0
  • I only used the WMIC so i could remove an existing printer with the same IP Address, so when it installed again, it would have my Common Name Scheme.  The WMIC isn't really required but I wanted to remove ANY printer that was already listed with a specific IP Address.

    0