Submitted By: Anonymous Submission

Lists installed applications in a Microsoft Excel spreadsheet.

Visual Basic
Edit|Remove
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Script Initialized"
   WScript.Echo "=========================================="

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
Set objWorksheet = objWorkbook.Worksheets(1)
x = 2

objExcel.Cells(1, 1).Value = "Name"
objExcel.Cells(1, 2).Value = "Location"
objExcel.Cells(1, 3).Value = "Vendor"
objExcel.Cells(1, 4).Value = "Version"
objExcel.Cells(1, 5).Value ="Computer"

strComputer = "."
Set objWMIService = _
    GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_Product")
For Each objItem in colItems
    objWorksheet.Cells(x, 1) = objItem.Name
    objWorksheet.Cells(x, 2) = objItem.InstallLocation
    objWorksheet.Cells(x, 3) = objItem.Vendor
    objWorksheet.Cells(x, 4) = objItem.Version    
    x = x + 1
Next

Set objRange = objWorksheet.UsedRange
objRange.EntireColumn.Autofit()