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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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
Answered 05/17/2007 by: dlernstrom
Senior Yellow Belt

Please log in to comment
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.
Answered 05/17/2007 by: dlernstrom
Senior Yellow Belt

Please log in to comment
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
Answered 05/17/2007 by: spartacus
Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity