I have a login script that adds printers to users profile like this:
Rundll32 printui.dll,PrintUIEntry /ga /n\\server\printer
However, i would like to remove all current printers on the machine before re-adding printers. I have found a command (dn) that will remove a printer however i would have to name every printer. Is there a command that will remove all printers?
I think you need these lines in a logon script, think it only does networked printers rather than local :
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * From Win32_Printer Where Network = True")
For Each objPrinter in colInstalledPrinters
Might be wrong though so please someone correct me if i am.
That seems to do the trick, thank you :-) For some reason the printer isnt installing quietly now even though i have the quiet command in ther, please see below:
cscript "C:\Documents and Settings\test.user\Desktop\DeletePrinters.vbs"
Rundll32 printui.dll,PrintUIEntry /in /q /n\\server\printer
The location of the script will be changed, just using that location for testing purposes for now. Any suggestions on silent install? Thank you, Richard