I am using the following code to find a list of Devices attached to COM Port.
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM MSSerial_PortName");
With Windows XP, the code works fine, but with Windows-7, I get an Access Denied Exception
. I am running under full administrative privilege in both the cases, then why would I face this error with Windows 7 and not XP.