WMI SQL查询错误

时间:2013-08-07 22:32:45

标签: c# wmi

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

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

错误是:“查询无效”

1 个答案:

答案 0 :(得分:0)

我想通了......我必须先把声明放在首位!

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