Hi, I want to use WMI to query which programs are installed. Firstly on the local machine, later also on remote machines, that's why i want to use WMI.
This is the code:
ManagementScope scope = new ManagementScope(@"\\" + server + @"\root\CIMV2"); ManagementObjectSearcher mos = new ManagementObjectSearcher( scope,new ObjectQuery("SELECT IdentifyingNumber, Name, Version FROM Win32_Product where InstallState = 5 and Vendor = 'Atomia AB'"),new EnumerationOptions() { ReturnImmediately = false}); ManagementObjectCollection products = mos.Get();
server is localhost in this case. The query returns 4 rows, i select 3 columns. I'm just wondering why it takes one minute to execute this little piece of code. Is there any way to speed this up?