Windows Driver Mgmt Tool

prnmngr.vbs

Windows Driver Mgmt Tool

prnmngr.vbs

Wednesday Feb 14, 2018


Adding and removing printers, especially in bulk, can be a real pain.

In these instances I leverage some VBScripts that is included with Windows.

Server 2008/Win 7/Vista/8/10

Windows XP


The other option is to access the PrintUI.dll directly using rundll32.  Rob van der Woude has a good explaination of it's usage here: http://www.robvanderwoude.com/...


LIST INSTALLED PRINTERS

cscript prnmngr.vbs -l
cscript prnmngr.vbs -l > list.txt

(this will write the output to a file vs. displaying onscreen, useful when the list is very large)


DELETE SPECIFIC PRINTER

  • cscript prnmngr.vbs -d -p "printer"
  • "printer" is the logical name of the printer from the list above.
  • NOTE: The printer must not have any jobs pending.  Delete any jobs from the queue either through the interface or via prnjobs.vbs.

DELETE ALL PRINTERS

  • cscript prnmngr.vbs -x
  • NOTE: To clean a system out run this command, restart the spooler (net stop spooler | net start spooler), and then run "cscript prndrvr.vbs -x"