Get Installed Software List

~OSD~ 2,126 Reputation points
2020-11-30T08:59:33.463+00:00

Hi,

On Windows 10 with multiple user accounts, there any several software installed. Some are installed on machine level (for all users) while other are installed for the current user (user level).
Can I get a list of installed software with information such as Application Name, Version, Installed Date and Installed For (All users or User Name) etc. using vb.net?

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,583 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Xingyu Zhao-MSFT 5,356 Reputation points
    2020-12-01T06:20:25.823+00:00

    Hi @~OSD~ ,
    Try to search for the following place in registry.

    SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

    Here's the code you can refer to.

    Dim appPATH As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

        Using rk As RegistryKey = Registry.LocalMachine.OpenSubKey(appPATH)  
            For Each name As String In rk.GetSubKeyNames()  
                Using sk As RegistryKey = rk.OpenSubKey(name)  
    
                    Dim displayName = sk.GetValue("DisplayName")  
                    Dim installDate = sk.GetValue("InstallDate")  
                    Dim version = sk.GetValue("DisplayVersion")  
    
                    If displayName IsNot Nothing Then  
                        If installDate IsNot Nothing AndAlso version IsNot Nothing Then  
                            Console.WriteLine($"Application Name: {displayName}")  
                            Console.WriteLine($"Version: {version}")  
                            Console.WriteLine($"Installed Date: {installDate}")  
                            Console.WriteLine()  
                        Else  
                            Console.WriteLine($"Application Name: {displayName}")  
                            Console.WriteLine()  
                        End If  
                    End If  
                End Using  
            Next  
        End Using  
        Console.ReadLine()  
    

    Hope it could be helpful.

    Best Regards,

    Xingyu Zhao
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Michael Taylor 48,976 Reputation points
    2020-11-30T15:34:05.693+00:00

    If you need this to work on older machines then use Win32_Product with WMI.

    For newer Windows you can use Powershell's Get-Package. However it only detects global and current user.

    If you have sufficient privileges then the alternative approach is to enumerate the registry. Refer to this blog article. You'll need to do that for global apps (HKLM) and for each user. However I really question why a per-user install would matter to you. Unless you're looking for "illegal" software then whether a user has a local install of something probably shouldn't matter. And for that a group policy might be a better approach.

    0 comments No comments

  3. ~OSD~ 2,126 Reputation points
    2020-12-01T08:19:03.707+00:00

    Hi and thanks Zhao for your reply. Tried it but nothing happened.

    Found a nice utility from NirSoft that can do almost everything I want, but wondering if same can be done /supported in vb.net as well? See sample output of UninstallView by NirSoft.

    43908-image.png