/build/static/layout/Breadcrumb_cap_w.png

Win32_Product error after installing msiexec 4.5

With msiexec v3.1 installed, run the below script. Then install v4.5 and rerun the script. What happened??

Option Explicit
'On Error Resume Next

Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim oMSI : Set oMSI = CreateObject("WindowsInstaller.Installer")
Dim oReg : Set oReg = GetObject("winmgmts://./root/default:StdRegProv")
Dim oWMI : Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Dim oXML : Set oXML = CreateObject("MSXML2.DOMDocument")
Dim oShell : Set oShell = CreateObject("WScript.Shell")

Dim item,ItemSet

Set ItemSet = oWMI.ExecQuery("SELECT * FROM Win32_Product")

MsgBox ItemSet.Count

For Each item in ItemSet
WScript.Echo "IdentifyingNumber: " & item.IdentifyingNumber
Next

0 Comments   [ + ] Show comments

Answers (3)

Posted by: anonymous_9363 15 years ago
Red Belt
0
I'll wager this issue is on Vista with 4.5, rather than XP with 4.5? I haven't run the script in v4.5 because I don't have it installed yet.

Reading through your script, though, I think the issue is with the impersonation, i.e. this line:

Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
I imagine Vista is whining that a priviliged operation (in Vista, that's practically everything, isn't it?!?) is being attempted from a non-privileged account.
Posted by: happyphunn 15 years ago
Senior Yellow Belt
0
Sorry, should have mentioned...this is on XP.
Posted by: anonymous_9363 15 years ago
Red Belt
0
What happens when you run it? Have you monitored execution with a process/file/registry monitor?
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ