dos命令:
wmic path win32_printer where network=true delete
vbs脚本:
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery("Select * from Win32_Printer where network=true")
For Each objPrinter in colInstalledPrinters
objPrinter.Delete_
Next
MsgBox "删除网络打印机完成"
时间: 2024-09-30 07:55:20