I have this vbscript which outputs all installed applications in a pc using this registry key :
HKEY_LOCAL_MACHINE \SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
Now i have this code to format and output all applications which only have DisplayName attribute.
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strComputer = "."
strKey = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
strEntry1a = "DisplayName"
strEntry1b = "QuietDisplayName"
strEntry2 = "InstallDate"
strEntry3 = "DisplayVersion"
set objReg = GetObject("winmgmts://" & strComputer & _
"/root/default:StdRegProv")
RegData = objReg.RegRead(RegValue)
objReg.EnumKey HKLM, strKey, arrSubkeys
WScript.Echo "Installed Applications"
For Each strSubkey In arrSubkeys
intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
strEntry1a, strValue1)
If intRet1 <> 0 Then
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry1b, strValue1
End If
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry2, strValue2
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry3, intValue3
strEntry6 = strValue1
If strValue2 <> "" Then
strEntry6 = strEntry6 & ";" & strValue2
Else
strEntry6 = strEntry6 & ";" & "-"
End If
If intValue3 <> "" Then
strEntry6 = strEntry6 & ";" & intValue3
Else
strEntry6 = strEntry6 & ";" & "-"
End If
If (strValue1 <> "") Then
WScript.Echo RegData
End If
Next
The problem is it produces duplicate data. I want to like filter and display only a unique DisplayName. I think the key here is for every loop, it checks if the same display name is found in other field. Im new to vbscripting and i barely know how to use the objects.