0

我不断收到与 OR 语句有关的 WMI 查询的错误输出。我读到 or 必须放在 AND 之后。我究竟做错了什么?

WqlEventQuery("SELECT * FROM __InstanceOperationEvent WITHIN 2 WHERE TargetInstance ISA 'Win32_Process' AND TargetInstance.Name = 'iexplore.exe' OR TargetInstance.Name = 'notepad.exe' ");

错误是这样的:“无效查询”

4

1 回答 1

0

我想通了...我必须先放 or 声明!

WqlEventQuery("SELECT * FROM __InstanceOperationEvent WITHIN 2 WHERE (TargetInstance.Name = 'notepad.exe' OR TargetInstance.Name = 'iexplore.exe') AND TargetInstance ISA 'Win32_Process'");
于 2013-08-07T22:40:45.227 回答