Can anyone help me im Trying to run the following function. I know the query works as I have used it in wbemtest. When i try execute this i get an Invalid Query error.
String^ Flash;
String^ Search = ("SELECT * FROM CIM_DataFile where (Drive='C:') AND (Path='\\Windows\\system32\\Macromed\\Flash\\') AND Name LIKE '%Flash%' AND Extension='ocx'");
ManagementObjectSearcher^ query = gcnew ManagementObjectSearcher(Search);
ManagementObjectCollection^ coll = query->Get();
for each (ManagementObject^ mo in coll)
{
Flash = ("" + mo["Version"]->ToString());
}
Can anyone please point me in the right direction? My other Queries work fine when im using Win32. But now that I'm using CIM_DataFile its not.