strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer where Name Like '%7th%'")
For Each objPrinter in colInstalledPrinters
objPrinter.Delete_
Next
Resource: http://www.cruto.com/resources/vbscript/vbscript-examples/printing/client/Delete-a-Printer.asp
No comments:
Post a Comment