title: querying registry using wmi query in windows
body: <p>I need to get installed software in as shows in Uninstall Program in control panel. So i used Win32_RegistryAction class for querying in vb script. But still i could not query a particular key and it hangs. Here is the piece of code which i used. Please help me how to get installed software details using wmi query.
  <br>Thanks in advance</p>
  
  <pre><code>strComputer = "."
  Set objWMIService = GetObject("winmgmts:" _
  &amp; "{impersonationLevel=impersonate}!\\" _
  &amp; strComputer &amp; "\root\cimv2")
  
  Set colSettings = objWMIService.ExecQuery _
  ("Select * from Win32_RegistryAction where key ='SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\' and Root=2 ")
  
  For Each objComputer in colSettings 
  Wscript.Echo "Display Name: " &amp; objComputer.DisplayName    
  Next
  </code></pre>