Returns a list of all software installed on a computer, whether or not by Windows Installer. The list is sorted by a bubble sort. This script reads installed applications from the registry.

Visual Basic
Edit|Remove
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strComputer = "."
strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
strEntry1a = "DisplayName"
strEntry1b = "QuietDisplayName"

Set objReg = GetObject("winmgmts://" & strComputer & _
 "/root/default:StdRegProv")
objReg.EnumKey HKLM, strKey, arrSubkeys
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
  If strValue1 <> "" Then
    strSubkeysRaw = strSubkeysRaw & strValue1 & ","
  End If
Next

If Right(strSubkeysRaw, 1) = ","Then
  strSubkeysPresort = LCase(Left(strSubkeysRaw, Len(strSubkeysRaw) - 1))
End If

arrSubkeysSort = Split(strSubkeysPresort, ",")

'Sort
For i = LBound(arrSubkeysSort) to UBound(arrSubkeysSort)
  For j = LBound(arrSubkeysSort) to UBound(arrSubkeysSort)
    If j <> UBound(arrSubkeysSort) Then
      If arrSubkeysSort(j) > arrSubkeysSort(j + 1) Then
         TempValue = arrSubkeysSort(j + 1)
         arrSubkeysSort(j + 1) = arrSubkeysSort(j)
         arrSubkeysSort(j) = TempValue
      End If
    End If
  Next
Next

WScript.Echo VbCrLf & "Installed Applications" & VbCrLf

For Each strSubkeySort in arrSubkeysSort
  WScript.Echo strSubkeySort
Next