Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click SoftwareInformationRegistry(TextBox1.Text) End Sub Public Sub SoftwareInformationRegistry(ByVal strComputer As String) Dim objLocator, objService, objRegistry, arrIdentityCode, strIdentityCode, objShell Dim strRegIdentityCodes As String objLocator = CreateObject("WbemScripting.SWbemLocator") Try objService = objLocator.ConnectServer(strComputer, "Root\Default") objRegistry = objService.Get("StdRegProv") Catch ex As Exception MsgBox("Unable to connect") Exit Sub End Try 'strRegIdentityCodes = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" strRegIdentityCodes = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" Const HKLM = &H80000002 Dim strRegIdentityInfo, strDisplayName, strDisplayVersion, strInstallDate, strUninstallString, strPublisher objRegistry.EnumKey(HKLM, strRegIdentityCodes, arrIdentityCode) objShell = CreateObject("WScript.Shell") For Each strIdentityCode In arrIdentityCode Try strRegIdentityInfo = "HKEY_LOCAL_MACHINE\" & strRegIdentityCodes & "\" & strIdentityCode & "\" strDisplayName = objShell.RegRead(strRegIdentityInfo & "DisplayName") strDisplayVersion = objShell.RegRead(strRegIdentityInfo & "DisplayVersion") strInstallDate = InstallDate(objShell.RegRead(strRegIdentityInfo & "InstallDate")) strUninstallString = objShell.RegRead(strRegIdentityInfo & "UninstallString") strPublisher = objShell.RegRead(strRegIdentityInfo & "Publisher") ListView1.Items.Add(strDisplayName) Catch ex As Exception Continue For End Try Next End Sub Private Function InstallDate(ByVal strDate As String) As String Try Dim YY, MM, DD As String YY = strDate.Substring(0, 4) MM = strDate.Substring(4, 2) DD = strDate.Substring(6, 2) Return DD & "-" & MM & "-" & YY Catch ex As Exception End Try End Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)