Deleting specific local printers via computer gpo script
Posted on 2007-08-01
I'm having trouble getting a local printer deleting script to work on WinXP machines. I can get the script to delete the computers local Printers when it boots but i want it to be more precise with what it actually deletes.
Our Prepress department have Creative Suite 2 which installs a local Adobe PDF printer. If I roll this script out as is it will delete this printer as well as the old ones we want to get rid of. I can not get it working as i keep getting an "unexpected next" error.
I want the script to be as generic as possible as there are loads of other departments with different print names so I would rather not have to specify each printer to delete.
Here is the code I have so far.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Network = FALSE")
For Each objPrinter in colInstalledPrinters
If objPrinter.Name = "Adobe PDF" or "Microsoft Office Document Image Writer" then