Link to home
Start Free TrialLog in
Avatar of QC20N
QC20NFlag for Denmark

asked on

Software collection

Hi,

I'm looking for at solution that do a software collection on the computer and outputs the result in a CSV file.

Br
Avatar of rgautier
rgautier
Flag of United States of America image

From this page: http://msdn.microsoft.com/en-us/library/aa394588(v=vs.85).aspx

comes the following code - which should do what you want.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
    ("Select * from Win32_Product")

For Each objSoftware in colSoftware
    Wscript.Echo "Name: " & objSoftware.Name
    Wscript.Echo "Version: " & objSoftware.Version
Next
Avatar of QC20N

ASKER

But this collect HW. I was interested in SW collection.
You asked the list of programs.  Therefore, there is only one column.

So here, the only thing that will look like a csv output file will be the extension.

wmic product get caption>C:\output.csv
ASKER CERTIFIED SOLUTION
Avatar of ReneGe
ReneGe
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of QC20N

ASKER

Not excat what I had in mind. But it is useful.
Glad i could help
Avatar of QC20N

ASKER

:)