Set wshShell = Wscript.CreateObject( "Wscript.Shell" )
strServer=wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile("software_list_" & strServer & ".txt", True)
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product")
For Each objSoftware in colSoftware
objTextFile.WriteLine objSoftware.name & "," & _
objSoftware.Vendor & "," & _
objSoftware.Version
Next
objTextFile.Close