Deleting a printer driver with scripting
-
Thursday, January 03, 2013 12:52 PM
I have a rather tricky situation regarding printers and migration to a new print server. Here is the story.
Around 200 clients where migrated from an old 2003 R2 print server to a new Win2008 R2 print server. I was using a script that just changed the string on each client computer from \\OLDSERVERNAME to \\NEWSERVERNAME for each printer, keeping the new shared printer on the new print server with the same name. All old client printers where manually added (point & click) on each client. All clients are Win7.
That worked out in the end, but a new situation appeared:
- A specific printer on the new print server was installed with some excotic european language instead of English. It was a fax printer, used to send fax directly from a client computer in the way of a printer.
- The language problem was of course not acceptable, so the printer was deleted and re-created on the print server with correct language.
- However, the clients still have the old printer driver (fax driver) installed with wrong language.So I was thinking of doing the following:
1. Script deleting of the old printer locally on each client (pretty easy, no problem).
2. Script deletion of the old print driver locally (much more difficult, no luck so far).
3. Deploy the new (and correct) printer with GPO/GPP.Step 2 puzzled me a bit, since I was trying a lot of different things including:
1. Deleting the print driver with prndrvr.vbs -d in a shutdown script (no luck, it says that the driver is still in use).
2. Deleting the print driver manually via PrinterManagement.msc (the same GUI as on the print server), but it says that the print driver is still in use.
3. Deleting all registry keys manually related to the old print driver (finally lucky, but not a solution for +200 clients).So do anyone have a suggestion for solving the print driver problem and delete the old print driver?
I could of course create some registry hacks and deploy it with GPO, but there are so many traces of the print driver in the registry so I would like to avoid it if possible.Thanks for all help :)
All Replies
-
Thursday, January 03, 2013 4:12 PM
Hi,
I've gone trough this type of problem in the past. Not exactly the same but very similar... I resolved my problems by using the printui.dll command line. This one is really worth trying. I used it to install printers on a machine rather than a user.
Here is a link to the documentation (PrintUI Users Guide) of this utility. It's word file published by Microsoft;
I've already wrote a little article on my blog with a couple of simple examples that can give you an idea of how to use it.
http://elmaskubilay.blogspot.ca/search?q=printui&x=0&y=0
Good luck.
Kubilay Elmas MCITP (Enterprise Desktop Administrator Windows 7)
- Edited by kubilayelmas Thursday, January 03, 2013 4:13 PM Added links
- Marked As Answer by ISP Services Sunday, January 06, 2013 6:09 PM
-
Friday, January 04, 2013 8:08 AMModerator
Hi,
Please try the suggestion provided by kubilavelmas and let us know the result.
Thanks.
TechNet Subscriber
Support
If you are TechNet Subscription user
and have any feedback on our support quality, please send your feedbackhere.Juke Chou
TechNet Community Support -
Friday, January 04, 2013 12:10 PM
So far it looks promising :)
I'm just surprised that it's deleting the printer driver without any error, since all the normal procedures throws an "printer driver in use" error.
Just have to test it in a script before I can close it, thanks for all help so far! -
Friday, January 04, 2013 12:54 PM
For the "printer driver in use" error. You can try to stop the "Print Spooler" service and then delete the drivers. If that works for you, you should maybe include stopping "print spooler" service in your script and restart the service once you've finished with all your operations.
Let us know please if all this works for you.
Kubilay Elmas MCITP (Enterprise Desktop Administrator Windows 7)
-
Sunday, January 06, 2013 6:09 PM
Wonderful, works like a charm.
Thank you!


