Tuesday, January 16, 2007

AD-COIT: Reader question about the installed application list

I received a good question today about the application report in AD-COIT - the reader asks...

"In the list of installed applications that I am seeing it looks like a few applications that are installed are missing from the output. Specifically, we have a line-of-business application that's not showing up on the list... why?"

First, thanks for trying out the script, and for sending in the question! To answer you, you're correct. AD-COIT only returns information about applications that were installed by the Windows installer. Let me step you though the code to give you an idea of what I'm doing...

If you have the script opened, go down and look at the "ListInstalledApplications" function, and you'll see the the following line...

"Set colItemsProduct = objWMIService.ExecQuery("Select * from Win32_Product")".

What I'm doing there is connecting to Win32_Product class, and returning the description and version information. So... you're next question might be... "how did you know that Win32_Product class only returns apps installed by the Windows installer?". I checked the MSDN site... which says, "The Win32_Product WMI class represents products as they are installed by Windows Installer."

By now, you might be thinking... "Great, you told me it's not comprehensive, you showed me why it's not comprehensive, but you didn't tell me how to make it comprehensive"!" ;)

As to getting the rest of the information... I know there's a registry key that houses uninstall information, you can use regedit to browse here... HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

As to getting it out of the registry... that's a good question. Take a look at the "SavDate" function... it uses the "reg" command to pull stuff out of the registry. You could probably take some of the code in the SavDate, and work on it until you pull what you want out of the appropriate keys. Which will probably be a bit of a challenge. That said, I was just browsing though Microsoft's scriptcenter and found a code snippet that looks like it does exactly what you're looking for... Look at the "List all Installed Software" linked here. You can try taking that code, and playing with it to get an idea of how it works. Then try adding it to the script, and let me know how it goes.

No comments: