New to VBS and probably having difficulty because of having used VBA.
Anyway I'm attempting to write a script to Enumerate software loaded on the
local PC and save it in an Excel Spreadsheet. And I gues my counter i = 2
and then most, of all, stepping i + 1 doesn't work with VBS.
Any ideas on how I can do this? If you try the script, note the
"C:\Scripts\EnumInstSW.xls"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\EnumInstSW.xls")
strComputer = "."
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Caption"
objExcel.Cells(1, 2).Value = "Description"
objExcel.Cells(1, 3).Value = "Identifying Number"
objExcel.Cells(1, 4).Value = "Install Date"
objExcel.Cells(1, 5).Value = "Install Location"
objExcel.Cells(1, 6).Value = "Install State"
objExcel.Cells(1, 7).Value = "Name"
objExcel.Cells(1, 8).Value = "Package Cache"
objExcel.Cells(1, 9).Value = "SKU Number"
objExcel.Cells(1, 10).Value = "Vendor"
objExcel.Cells(1, 11).Value = "Version"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("SELECT * FROM Win32_Product")
i = 2
For Each objSoftware in colSoftware
objExcel.Cells(i, 1).Value = objSoftware.Caption
objExcel.Cells(i, 1).Value = objSoftware.Description
objExcel.Cells(i, 1).Value = objSoftware.IdentifyingNumber
objExcel.Cells(i, 1).Value = objSoftware.InstallLocation
objExcel.Cells(i, 1).Value = objSoftware.InstallState
objExcel.Cells(i, 1).Value = objSoftware.Name
objExcel.Cells(i, 1).Value = objSoftware.PackageCache
objExcel.Cells(i, 1).Value = objSoftware.SKUNumber
objExcel.Cells(i, 1).Value = objSoftware.Vendor
objExcel.Cells(i, 1).Value = objSoftware.Version
i + 1
Next