Creating Windows Server Print Queues From the Cmd Line

I’d been given the task of setting up two Windows print servers with a touch over 300 print queues. The queues would be split between the two servers, with one holding all the even numbered queues (they’re named things like CityA094 or CityB031) and the other the odd names.

Well, it gets rather boring doing this via the GUI. The process of creating the TCP/IP ports, then the queues and entering the location information takes a fair number of clicks and typing. With only the queue name, location and description changing between each, it’s a good task for a script.

You need three VBS files that already exist on a Windows XP system, a target server and a logon to that server. The three VBS files are prncnfg.vbs, prnmngr.vbs and prnport.vbs which should be in your (windows root)system32 folder.

Then use the following in a batch script to call them to do the work. It’ll create the port (using RAW mode), then the queue and then configure the queue.

WordPress really doesn’t like the script syntax and is getting a little confused so here it is in a text file: AddPrinter Script.

Note that I’m only using the Generic/Text driver for all queues, so the
usefulness may vary if you’ve got lots of different models.

Leave a Reply

Your email address will not be published. Required fields are marked *