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

Visual Basic
Edit|Remove
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
Const adVarChar = 200' Set the data type to variant.
Const MaxCharacters = 100
Const adSingle = 4
strComputer = "."
strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
strEntry1a = "DisplayName"
strEntry1b = "QuietDisplayName"
strEntry2 = "VersionMajor"
strEntry3 = "VersionMinor"
strEntry4 = "InstallDate"
strEntry5 = "EstimatedSize"

Set DataList = CreateObject("ADOR.Recordset")
DataList.Fields.Append "DisplayName", adVarChar, MaxCharacters
DataList.Fields.Append "Version", adVarChar, MaxCharacters
DataList.Fields.Append "InstallDate", adVarChar, MaxCharacters
DataList.Fields.Append "EstimatedSize", adVarChar, MaxCharacters
DataList.Open

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
    intRet2 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
     strEntry1b, strValue1)
    If intRet2 <> 0 Then
      strValue1 = strSubkey
    End If
  End If
  objReg.GetDWORDValue HKLM, strKey & strSubkey, _
   strEntry2, intValue2
  objReg.GetDWORDValue HKLM, strKey & strSubkey, _
   strEntry3, intValue3
  If (Not IsNull(intValue2)) And (Not IsNull(intValue3)) Then
    strVersion = intValue2 & "." & intValue3
  Else
    strVersion = ""
  End If
  objReg.GetStringValue HKLM, strKey & strSubkey, _
   strEntry4, strValue4
  If Not IsNull(strValue4) Then
    strInstallDate = Mid(strValue4, 5, 2) & "/" & Right(strValue4, 2) & _
     "/" & Left(strValue4, 4)
  Else
    strInstallDate = ""
  End If
  objReg.GetDWORDValue HKLM, strKey & strSubkey, _
   strEntry5, intValue5
  If Not IsNull(intValue5) Then
    strEstimatedSize = CStr(Round(intValue5/1024, 3))
  Else
    strEstimatedSize = ""
  End If
  DataList.AddNew
  DataList("DisplayName") = strValue1
  DataList("Version") = strVersion
  DataList("InstallDate") = strInstallDate
  DataList("EstimatedSize") = strEstimatedSize
  DataList.Update
Next

DataList.Sort = "DisplayName"
DataList.MoveFirst

WScript.Echo VbCrLf & "Installed Applications"

Do Until DataList.EOF
  Wscript.Echo VbCrLf & DataList.Fields.Item("DisplayName") & _
   VbCrLf & "  Version: " & DataList.Fields.Item("Version") & _
   VbCrLf & "  InstallDate: " & DataList.Fields.Item("InstallDate") & _
   VbCrLf & "  EstimatedSize (MB): " & DataList.Fields.Item("EstimatedSize")
  DataList.MoveNext
Loop

DataList.Close