Can't get software information using wmi on 64-bit

Discussion in 'Windows 64bit' started by =?Utf-8?B?aWFuODA3?=, Mar 27, 2006.

  1. 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
    =?Utf-8?B?aWFuODA3?=, Mar 27, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    >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
    Ken Tucker [MVP], Mar 27, 2006
    #2
    1. Advertising

  3. 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" <> wrote in message
    > news:...
    > >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

    >
    >
    >
    =?Utf-8?B?aWFuODA3?=, Mar 28, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    720
  2. Replies:
    0
    Views:
    580
  3. renu_gautam

    HBA info using WMI

    renu_gautam, Mar 26, 2008, in forum: Software
    Replies:
    1
    Views:
    1,441
    mdnchauhan
    May 21, 2008
  4. Howard Woodard

    Can't get 32 bit reliability on 64 bit platform

    Howard Woodard, Nov 13, 2008, in forum: Windows 64bit
    Replies:
    1
    Views:
    1,488
    R. C. White
    Nov 18, 2008
  5. BP
    Replies:
    2
    Views:
    1,075
    PhilSweet
    Dec 19, 2008
Loading...

Share This Page