Prev: How to check each startup process processing time
Next: VbScript and Windows 7 x64 - in IEx64 vbscript works, but notin I
From: Avinash Deshpande Avinash on 24 May 2010 09:37 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
From: Mayayana on 24 May 2010 19:16 I don't see those properties listed in the WMI help, and I don't see any such values under the Uninstall key for software installed via MSI. I have the WMI v. 1 help and also the server 2003 version help. Also see here: http://msdn.microsoft.com/en-us/library/aa394378(VS.85).aspx It looks like the property is new and therefore can't be depended upon. |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
From: Avinash Deshpande on 25 May 2010 11:57 Hi, Thanks for your reply. If you browse for the link that you provided kindly go through the page. At the bottom of the page we can find the 2 properties that i had listed. RegCompany Data type: string Access type: Read-only The company registered to use the product. Windows Server 2003, Windows XP, and Windows 2000: This property is not available. RegOwner Data type: string Access type: Read-only The owner registered to use the product. Windows Server 2003, Windows XP, and Windows 2000: This property is not available. "Mayayana" wrote: > I don't see those properties listed in the WMI help, > and I don't see any such values under the Uninstall > key for software installed via MSI. I have the WMI v. 1 > help and also the server 2003 version help. > > Also see here: > http://msdn.microsoft.com/en-us/library/aa394378(VS.85).aspx > > It looks like the property is new and therefore can't > be depended upon. > > |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 > > > . >
From: Mayayana on 25 May 2010 12:45 | | If you browse for the link that you provided kindly go through the page. At | the bottom of the page we can find the 2 properties that i had listed. | Yes, that's what I meant. It's there, but: | | Windows Server 2003, Windows XP, and Windows 2000: This property is not | available. You didn't say what system you're using. If you're not using Vista/7 then you apparently can't use the properties. Win32_Product is actually just a partial wrapper around the WindowsInstaller.Installer object. (It only sees software installed via MSI.) But RegOwner and RegCompany sound like add-ons. In other words, reg. information entered during install is not normally part or either WMI or MSI. So I'd guess that Vista/7 have somehow standardized a method to store that info. in the Registry, and that WMI is retrieving it from there. Looking in XP I find this: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData Even though WMI/MSI in XP doesn't have the RegOwner and RegCompany properties, they can be found in subkeys there. There's one problem, though. In my own case, the only software I ever entered my name into during install was VS6. Yet most of the software I have under that key has my name. It was stolen from the VS Registry entries here: HKEY_CURRENT_USER\Software\Microsoft\MS Setup (ACME) So there are three minor drawbacks to be aware of: 1) What you want is only available with MSI installs. 2) The info. itself is not dependable. [Though of course it never is, anyway. No one has to enter true info.] 3) Prior to Vista/7 you'll probably have to dig in the Registry to find it.
From: Avinash Deshpande on 27 May 2010 17:39
Hi, Thanks. I am using Windows XP and i was trying to get the information for all the Microsoft Products that are installed on my PC and on Network PCs. Do we have any VB script which will get the information? "Mayayana" wrote: > | > | If you browse for the link that you provided kindly go through the page. > At > | the bottom of the page we can find the 2 properties that i had listed. > | > > Yes, that's what I meant. It's there, but: > | > | Windows Server 2003, Windows XP, and Windows 2000: This property is not > | available. > > You didn't say what system you're using. If you're > not using Vista/7 then you apparently can't use > the properties. > > Win32_Product is actually just a partial wrapper around > the WindowsInstaller.Installer object. (It only sees software > installed via MSI.) But RegOwner and > RegCompany sound like add-ons. In other words, reg. > information entered during install is not normally part or > either WMI or MSI. So I'd guess that Vista/7 have somehow > standardized a method to store that info. in the Registry, > and that WMI is retrieving it from there. > > Looking in XP I find this: > > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData > > Even though WMI/MSI in XP doesn't have the RegOwner and > RegCompany properties, they can be found in subkeys > there. There's one problem, though. In my own case, the > only software I ever entered my name into during install > was VS6. Yet most of the software I have under that key > has my name. It was stolen from the VS Registry entries > here: > > HKEY_CURRENT_USER\Software\Microsoft\MS Setup (ACME) > > So there are three minor drawbacks to be aware of: 1) What > you want is only available with MSI installs. 2) The info. itself > is not dependable. [Though of course it never is, anyway. No one > has to enter true info.] 3) Prior to Vista/7 you'll probably have to > dig in the Registry to find it. > > > > > . > |