[gptalk] Re: I Need The Perfect Desktop WMI Filter

  • From: "Darren Mar-Elia" <darren@xxxxxxxxxx>
  • To: <gptalk@xxxxxxxxxxxxx>
  • Date: Sun, 10 Feb 2008 11:34:12 -0800

Jakob-

I think you were close when you were using Win32_Battery. That is the one
thing that you can reliably say that laptops have, but desktops don't. So,
have you tried the following:

 

Select * from Win32_Battery

 

Just that. Nothing else. What that does is determine if there are any
instances of that class. If not (i.e., on a desktop machine) it returns
false. If so, on a laptop, it returns true. 

 

Waddya think?

 

Darren

 

From: gptalk-bounce@xxxxxxxxxxxxx [mailto:gptalk-bounce@xxxxxxxxxxxxx] On
Behalf Of Jakob H. Heidelberg
Sent: Sunday, February 10, 2008 8:36 AM
To: gptalk@xxxxxxxxxxxxx
Subject: [gptalk] I Need The Perfect Desktop WMI Filter

 

Hi all,

 

I'm in desperate need of *the perfect WMI filter for spotting DESKTOP
computers only* - have been thinking about this for some days now.

 

I've been around solutions looking for ChassisType before - which basically
doesn't work because that's an Array. Have tried PowerSupplyState,
DesktopMonitor, DisplayConfiguration and others - just haven't found the
perfect "this is definitely a desktop WMI value"...

 

I've also been around using Battery/PortableBattery
/PCMCIAController/POTSModem - which all work fine to spot LAPTOPS...
However, desktops don't know the CLASS at all, so they return FALSE no
matter what. I can't even say things like "Select * From Win32_Battery Where
Availability != 2" or "Where Not X Like Y" or whatever - a desktop doesn't
handle the Win32_Battery class at all, so it's gonna say "Heck, I don't know
anything about that class *Panic* - I'm out!" - or just "False" J.

 

The thing is, that normally it's the LAPTOPS that have special hardware -
like Batteries and built-in Modems, PCMCIA slots etc. - so they are pretty
easy to find. With desktop computers it's another story for my part - hope
you can help me out here.

 

Please - I know lot's of "workarounds", but what I need is a *WMI filter*
and it has to return *TRUE* for *DESKTOPS* (or let's call the NON-LAPTOPS,
it doesn't matter). Also, if the customer had used computer names like
"DESKxxx" for desktops and "LAPTxxx" for laptops, I know I could have used
WMI filters for computer name - but unfortunately that's not the case. You
could say I'm looking for a global solution for spotting DESKTOPS using WMI
filter - I know lots of cases where this could come in handy.

 

 

Hope to hear from you soon! J

 

 

Best regards
Jakob H. Heidelberg

 

Other related posts: