I am unable to retrieve software information on 64-bit XP via WMI.
For example, this code:

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)

For Each objSoftware in colItems
Wscript.Echo objSoftware.Description & ", " & objSoftware.Name & ",
" & objSoftware.Vendor & ", " & objSoftware.Version
Next


works perfectly on any Windows XP 32-bit system, but not on any Windows XP
64-bit system.

Thanks in advance for anly help
Ian

Re: Can't get software information using wmi on 64-bit by Ken

Ken
Mon Mar 27 16:49:38 CST 2006

Hi,

This worked.

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
set colItems = objWMIService.ExecQuery("Select * from Win32_Product")

For Each objSoftware in colItems
Wscript.Echo objSoftware.Description & ", " & objSoftware.Name & ","
& objSoftware.Vendor & ", " & objSoftware.Version
Next

Ken
-----------------
"ian807" <ian807@discussions.microsoft.com> wrote in message
news:4D039204-7FC4-4462-9CE5-4EC8F5D25330@microsoft.com...
>I am unable to retrieve software information on 64-bit XP via WMI.
> For example, this code:
>
> On Error Resume Next
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
> set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)
>
> For Each objSoftware in colItems
> Wscript.Echo objSoftware.Description & ", " & objSoftware.Name & ",
> " & objSoftware.Vendor & ", " & objSoftware.Version
> Next
>
>
> works perfectly on any Windows XP 32-bit system, but not on any Windows XP
> 64-bit system.
>
> Thanks in advance for anly help
> Ian



Re: Can't get software information using wmi on 64-bit by ian807

ian807
Tue Mar 28 09:27:05 CST 2006

Ken,

Thanks for the reply, however, the results are identical. The modified code
worked perfectly on both of my test 32-bit systems, but failed on 2 randomly
selected 64-bit systems. Attempting the same thing in a vb.net application
(i.e. accessing software information via wmi) yielded exactly the same
results.

The results seem quite specific to this query. No other wmi query I've tried
has failed or even acted differently on a 64-bit system.

Curiouser and curiouser,
Ian


"Ken Tucker [MVP]" wrote:

> Hi,
>
> This worked.
>
> Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
> set colItems = objWMIService.ExecQuery("Select * from Win32_Product")
>
> For Each objSoftware in colItems
> Wscript.Echo objSoftware.Description & ", " & objSoftware.Name & ","
> & objSoftware.Vendor & ", " & objSoftware.Version
> Next
>
> Ken
> -----------------
> "ian807" <ian807@discussions.microsoft.com> wrote in message
> news:4D039204-7FC4-4462-9CE5-4EC8F5D25330@microsoft.com...
> >I am unable to retrieve software information on 64-bit XP via WMI.
> > For example, this code:
> >
> > On Error Resume Next
> > strComputer = "."
> > Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
> > set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)
> >
> > For Each objSoftware in colItems
> > Wscript.Echo objSoftware.Description & ", " & objSoftware.Name & ",
> > " & objSoftware.Vendor & ", " & objSoftware.Version
> > Next
> >
> >
> > works perfectly on any Windows XP 32-bit system, but not on any Windows XP
> > 64-bit system.
> >
> > Thanks in advance for anly help
> > Ian
>
>
>