Strange WMI behaviour
Posted: 08-11-2005, 06:58 PM
application has been installed. My code is thus:
Dim myObjectSearcher As System.Management.ManagementObjectSearcher
Dim myCollection As System.Management.ManagementObjectCollection
Dim myObject As System.Management.ManagementObject
Dim bolFound As Boolean = False
myObjectSearcher = New
System.Management.ManagementObjectSearcher("Select * From Win32_Product
Where Caption = ""Magic Widget App""")
myCollection = myObjectSearcher.Get()
For Each myObject In myCollection
' Because we've filtered the collection fetching, ANY entry must
be a match
bolFound = True
Exit For
Next
What I'm finding is that, occasionally (*), the code just seems to stop at
the For Each loop. It doesn't crash - it just seems to stop and not go any
further.
(*) It seems to happen more often when I'm logged on at the computer using
cached credentials.
I'm running the code on XP SP 2 with a normal user account.
Is there anything wrong with my code? Has anyone else come across this?
--Philip



Linear Mode

