Windows Driver Tool

prndrvr.vbs

Windows Driver Tool

prndrvr.vbs

Wednesday Feb 14, 2018


It seems more and more that customers have issues with drivers.  Often it's a case that there is an old driver on the system and the new driver isn't overwriting properly.  It's also nice to simply remove old, unwanted drivers that are no longer in use.

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/2kprintcontrol.php


LIST INSTALLED DRIVERS

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

*the > list.txt will write the output to a file vs. displaying onscreen, useful when the list is very large

listdrivers.png

DELETE SPECIFIC DRIVER

cscript prndrvr.vbs -d -m "drivername" -v "version" -e "environment" 

*details found from the 'list' function above

remove_driver.png

cscript prndrvr.vbs -d -m "Xerox Phaser 6180MFP-D PCL 6,3" -v 3 -e "Windows x64"

NOTE: The driver cannot be currently in use, any printers assocated with this driver must be first deleted.  Once the printer is removed you may need to restart the spooler  (net stop spooler | net start spooler) to release the lock on the files.


DELETE ALL DRIVER NOT IN USE

cscript prndrvr.vbs -x

NOTE: Just like above, drivers will not be removed if they are in use.  Remove all printers and restart the spooler (net stop spooler | net start spooler) then run this command.


ADD DRIVERS

prndrvr.vbs can also be used to add drivers to the system.  This is useful with prnmngr.vbs that can add printers via the command line.  A script/batch file could be used to add the drivers and then install the printer.  See the -a argument for adding drivers via prndrvr.vbs and the our related document on managing printers using prnmngr.vbs.