WMIC语法删除打印机不喜欢

时间:2016-09-28 00:22:29

标签: syntax wmi wmi-query wmic

我需要一个wmic脚本来删除DeviceID不喜欢'%%KM%%'

的所有打印机

以下语法可以删除

之类的内容
printer where "DeviceID LIKE '%%KM%%'" delete

当我改为

printer where "DeviceID NOT LIKE '%%KM%%'" delete

我明白了 ERROR:

Description = Invalid query

我该如何进行此更改?

1 个答案:

答案 0 :(得分:1)

尝试:

wmic printer where "deviceid like '%<Name>%'" delete

<强>更新

wmic printer where "NOT deviceid like '%<Name>%'" delete