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
0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


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.
Answered 10/27/2008 by: VBScab
Red Belt

Please log in to comment
Sorry, should have mentioned...this is on XP.
Answered 10/27/2008 by: happyphunn
Senior Yellow Belt

Please log in to comment
What happens when you run it? Have you monitored execution with a process/file/registry monitor?
Answered 10/27/2008 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity