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
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)
Please log in to answer
Posted by:
anonymous_9363
16 years ago
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:
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.
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:
anonymous_9363
16 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.