Lo group,

The following is driving me crazy:

I have connected to WMI (Win32_BaseBoard) to get some info about my
motherboard. As long as I hardcode the propertyname (for example
objWMI.Manufacturer) everything works fine (displays Asus).

However, what I would like to do is use a variable containing the value
"Manufacturer" and use that instead of the hardcoded propertyname.
Simply put I want something like objWMI.strKeyName.

Can it be done ?!?

TIA,
SomeDude

Re: WMI using a variable as the propertyname by JTW

JTW
Wed Aug 16 16:34:40 CDT 2006

No, because in your example, "strKeyName" would then be a "hardcoded"
property name. You can try something like this:

WScript.Echo objItem.properties_(strKeyName)

Re: WMI using a variable as the propertyname by SomeDude

SomeDude
Wed Aug 16 16:50:54 CDT 2006

On Wed, 16 Aug 2006 14:34:40 -0700, JTW wrote:

> No, because in your example, "strKeyName" would then be a "hardcoded"
> property name. You can try something like this:
>
> WScript.Echo objItem.properties_(strKeyName)

Thanks a lot JTW,

That was just what I was looking for.
FYI, strKeyName is filled by an array-loop ofcourse ;)

SomeDude