/build/static/layout/Breadcrumb_cap_w.png

Script to Uninstall Printers

Has anyone come across a script that will uninstall all current printers on a user's machine and install new printers that you specify?

0 Comments   [ + ] Show comments

Answers (3)

Posted by: dlernstrom 16 years ago
Senior Yellow Belt
0
Currently, we use a login script to install printers that have been shared from a server. One of our servers has about 10 network printers installed on it that are shared. The login script that all users run installs that shared printer.

On my current 'todo' list is to switch that install over to MSI. I ran across a method that allows for printers to be installed via an MSI software install. Once we switch over to that, we can reduce the time that this particular login script takes to execute.

Let me know if something like this is what you are after and how urgently you'd like me to tackle my project.

-David
Posted by: dlernstrom 16 years ago
Senior Yellow Belt
0
I've dug around into my files and found my notes... The idea is to use WIWW to wrap two command line entries, one for install and one for uninstall.

The install would look something like this:
rundll32 printui.dll,PrintUIEntry /if /b "HPLJ4-RIGHTFAX" /f %windir%\inf\ntprint.inf /r "lpt1:" /m "HP LaserJet 4"

The uninstall would look something like this:
rundll32 printui.dll,PrintUIEntry /dl /n "HPLJ4-RIGHTFAX"

I haven't verified the command line parameters. I merely cut and pasted them from a reference I ran across. The potential exists that they are not entirely constructed correctly, so verify all parameters before you attempt it.
Posted by: spartacus 16 years ago
Black Belt
0
Here's the first step to get you started :

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Network = FALSE")

For Each objPrinter in colInstalledPrinters
objPrinter.Delete_
Next


Regards,

Spartacus
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ