A
Avinash Deshpande
I am using RegOwner and RegCompany Objects of Win32_Product Class to get the
Product details of the Microsoft applications installed on my machine. I was
using the code below
StrComputer = "."
Function DispList(StrComputer)
DIM objFSO, objWMIService, colSoftware, objSoftware
Set objFSO = CreateObject("Scripting.FileSystemObject")
DIM OutputFile
DIM objFile
OutputFile = "D:\output.txt"
Set objFile = objFSO.CreateTextFile(OutputFile)
objFile.WriteLine "Software list for " & StrComputer
Set objWMIService = GetObject("winmgmts:\\" & StrComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery ("Select * from Win32_Product
where Name like 'Microsoft Office%'")
objFile.WriteLine "Name " & vbtab & "Version "
For Each objSoftware in colSoftware
objFile.WriteLine objSoftware.Name & "," & objSoftware.Version &
"," & objSoftware.RegCompany & "," & objSoftware.RegOwner
Next
Set objFile = Nothing
Set objFSO = Nothing
End function
When running the code i get error at RegOwner and RegCompany which says
"Object doesn't support this property or method "objSoftware.RegOwner" Error
Code: 800A01B6
Please let me know how can i get the details
Product details of the Microsoft applications installed on my machine. I was
using the code below
StrComputer = "."
Function DispList(StrComputer)
DIM objFSO, objWMIService, colSoftware, objSoftware
Set objFSO = CreateObject("Scripting.FileSystemObject")
DIM OutputFile
DIM objFile
OutputFile = "D:\output.txt"
Set objFile = objFSO.CreateTextFile(OutputFile)
objFile.WriteLine "Software list for " & StrComputer
Set objWMIService = GetObject("winmgmts:\\" & StrComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery ("Select * from Win32_Product
where Name like 'Microsoft Office%'")
objFile.WriteLine "Name " & vbtab & "Version "
For Each objSoftware in colSoftware
objFile.WriteLine objSoftware.Name & "," & objSoftware.Version &
"," & objSoftware.RegCompany & "," & objSoftware.RegOwner
Next
Set objFile = Nothing
Set objFSO = Nothing
End function
When running the code i get error at RegOwner and RegCompany which says
"Object doesn't support this property or method "objSoftware.RegOwner" Error
Code: 800A01B6
Please let me know how can i get the details