WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.


Printer Controller

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Publish a Printer to AD using pSetPrtInfo


I am working on a script that will create print queues on a remote print server. The problem is I cannot figure out how to use request 12 to share the printer or publish in AD. The help file does not provide any examples on how to do this. I am using WWPRT44I.DLL= With 2004D

I don't understand how I share a printer using this command. How do I "flip" the 8th bit for sharing or the 8192 bit for Publishing. There is not enough arguments to add a 0 or a 1 .. I am confused...

pSetPrtInfo((STRCAT("\\",PRTSRV,"\",QUEUE)),12 ,81)
Any Ideas


The PRINTER_ATTRIBUTE_PUBLISHED flag merely indicates whether the printer is published in the directory service. It doesn't seem to actually publish the printer.

I did a little research on how to publish a printer....;en-us;234619

For NON Windows 2000-Based Computers publishing can be accomplished by running a script on the system called 'pubprn.vbs'.


The pSetPrtInfo function simply calls the SetPrinter API to set the data for a specified printer. It currently uses the PRINTER_INFO_2 structure to set detailed information about the printer. The following tech article states that the SetPrinter API should use the PRINTER_INFO_7 structure. The dwAction member of this structure indicates whether SetPrinter should publish, unpublish, re-publish, or update the printer's data in the directory service.

Print Spooler Support for Printer Directory Services We may need to update the pSetPrtInfo Function to handle for this. I will pass this request on to our developers.


Looks like a new printer function will be necessary to publish a printer. That is currently in the works.
Article ID:   W16355
File Created: 2017:07:28:13:58:38
Last Updated: 2005:02:18:12:19:59