Avatar of whorsfall
whorsfallFlag for Australia

asked on 

C# get a list of programs instatlled on a remote machine (Add/Remove Programs)?

Hi,

I am looking at a good way I can interrogate remote machines to work out what software is installed
in Add/Remove programs via C#.

The issue is the various methods return different results.

Some people say don't use Win32_product. Some were saying this is bad for performance.

However the other methods don't seem to return the correct count.

Here are some interesting results....

Add/Remove control panel applet            - 108 programs installed

Now compare this to the various methods:

select * from win32_product                - 186 items.
select * from Win32reg_AddRemovePrograms   - 71 objects.
select * from Win32Reg_AddRemovePrograms64 - 71 objects.

So why is there such a variance - I would of thought they should be *exactly* the same if not
close.

What are other peoples thought on the best method?
Why such a variance?
If I don't mind a performance hit is there anything wrong with using Win32_product?

Thanks,

Ward.
C#.NET Programming

Avatar of undefined
Last Comment
Kimputer
Avatar of Kimputer
Kimputer

Win32_product shows only MSI installer products. Software using their own installer won't show.
Try to list it with an internal process and capture the output of
wmic product list brief
Avatar of whorsfall
whorsfall
Flag of Australia image

ASKER

Hi,

Thanks for your response.

Can you clarify what you mean when you say:

Try to list it with an internal process and capture the output of
 wmic product list brief

So are u saying I should be capturing the output of:
 wmic product list brief

Thanks,
Ward.
Avatar of Kimputer
Kimputer

Yes, in VB it's like this:

Dim p As ProcessStartInfo = New System.Diagnostics.ProcessStartInfo("wmic", "product list brief")

You can probably easily translate this to C#, and then capture the output (each line is a software product, only the name)? That's all.
SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Kimputer
Kimputer

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo