WMI query stop working in Windows 8.1 and Windows 10 preview?

@Christian Schmitz

Hi,

I just did a test for my recent project with WindowsWMIMBS plug-in under Windows 8.1 x64 and Windows 10 preview. My code is something like following,

If TargetWin32 Then
    w = New WindowsWMIMBS
    If w.ConnectServer("root\\cimv2") Then
      If w.query("WQL","Select * from Win32_PnPEntity WHERE Description = 'USB Serial Port'") Then
        While w.NextItem
          s1 = w.GetProperty("Manufacturer")
          s2 = w.GetProperty("Name")
          s3 = w.GetProperty("DeviceID")
          If s1 = "MMMM" and InStr(s3, "VID_XXXX+PID_XXXX") <> 0 Then
            deviceCnt = deviceCnt + 1
          End If
        Wend
      End If
    End If

  End If

When the app ran to “If w.query(“WQL”,“Select * from Win32_PnPEntity WHERE Description = ‘USB Serial Port’”) Then”, the w.query(…) returns false.
I also tried “If w.query(“WQL”,“Select * from Win32_PnPEntity”) Then”, it’s also returns false.

Another example is I ran the MBS example, Win\WMI\WMI query. it used to work in Windows 7 and 8, but now it doesn’t work in Windows 8.1 and 10 either.

Anyone met this problem before? Thanks in advance.

from the MBS web site:

Could this be relevant?

[quote=188730:@Louis Desjardins]from the MBS web site:

Could this be relevant?[/quote]

Yep, this is the case. In app.open event should add

Call WindowsWMIMBS.InitSecurity(false)

Thank you very much! I tested in Windows 8.1, it works now. I will try windows 10 and update later.

Cool. Even answered before I had the time to do it!
Thanks Louis.