Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WMI "installed" query different from add/remove programs list?

Trying to use WMI to obtain a list of installed programs for Windows XP. Using wmic, I tried:

wmic /output:c:\ProgramList.txt product get name,version 

and I get a listing of many of the installed programs, but after scrubbing this list against what "Add/Remove Programs" displays, I see many more programs listed in the GUI of Add/Remove Programs than with the WMI query. Is there another WMI query I need to use to get the rest of the programs installed? Or is there some other place I need to look for the rest?

Also, there are two installed programs that are listed in the WMI query that aren't in Add/Remove programs. Any idea why?

like image 917
romandas Avatar asked Mar 23 '09 12:03

romandas


People also ask

What is used for changing display settings addition or removal of programs?

The Control Panel is a component of Microsoft Windows that provides the ability to view and change system settings. It consists of a set of applets that include adding or removing hardware and software, controlling user accounts, changing accessibility options, and accessing networking settings.

What is add remove programs called in current operating systems?

In Windows Vista and Windows 7, this feature was renamed to Programs and Features. Then, in the latest Microsoft Operating System, Windows 10, this feature is called Apps & features.

What is Win32_Product?

The Win32_Product class enables you to enumerate the software installed on a computer, provided the software was installed by using the Windows Installer.


2 Answers

I believe your syntax is using the Win32_Product Class in WMI. One cause is that this class only displays products installed using Windows Installer (See Here). The Uninstall Registry Key is your best bet.

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

UPDATE FOR COMMENTS:

The Uninstall Registry Key is the standard place to list what is installed and what isn't installed. It is the location that the Add/Remove Programs list will use to populate the list of applications. I'm sure that there are applications that don't list themselves in this location. In that case you'd have to resort to another cruder method such as searching the Program Files directory or looking in the Start Menu Programs List. Both of those ways are definitely not ideal.

In my opinion, looking at the registry key is the best method.

like image 85
Rob Haupt Avatar answered Sep 23 '22 10:09

Rob Haupt


All that Add/Remove Programs is really doing is reading this Registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall 
like image 35
BobbyShaftoe Avatar answered Sep 20 '22 10:09

BobbyShaftoe