Advertisement
calfred2808

View List of Softwares installed

Nov 28th, 2019
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.03 KB | None | 0 0
  1. Imports System
  2. Imports System.Management
  3. Imports System.Windows.Forms
  4. Imports Microsoft.Win32
  5.  
  6.  
  7.  
  8.     Private Sub ViewSoftwareInstalled()
  9.         Dim RegKey, subkey As Microsoft.Win32.RegistryKey
  10.         Dim Value As String
  11.         Dim RegPath As String = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
  12.         RegKey = My.Computer.Registry.LocalMachine.OpenSubKey(RegPath)
  13.         Dim Subkeys() As String = RegKey.GetSubKeyNames
  14.         Dim Includes As Boolean
  15.  
  16.         For Each subk As String In Subkeys
  17.             subkey = RegKey.OpenSubKey(subk)
  18.             Value = subkey.GetValue("DisplayName", "")
  19.             If Value <> "" Then
  20.                 Includes = True
  21.                 If Value.IndexOf("Hotfix") <> -1 Then Includes = False
  22.                 If Value.IndexOf("Security Update") <> -1 Then Includes = False
  23.                 If Value.IndexOf("Update for") <> -1 Then Includes = False
  24.                 If Includes = True Then ListBox_Softwares.Items.Add(Value)
  25.  
  26.  
  27.             End If
  28.  
  29.         Next
  30.  
  31.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement