PC Review


Reply
Thread Tools Rate Thread

Win32_Processor.Name versus Win32_Processor.Family

 
 
David Holcomb
Guest
Posts: n/a
 
      5th Aug 2004
I see some inconsistencies between Win32_Processor.Name and
Win32_Processor.Family, and I would like to understand if this behavior is
intentional or a bug in WMI.

* I have a machine at home where Win32_Processor.Name is reported as "AMD
Athlon(TM) XP 1900+" but the Win32_Processor.Family is reported as a value
of 29, which is supposed to be "AMD Duron". I thought in this case the
processor family would return value 28 for "AMD Athlon". I realize there
may be something in the relationship between these two processors I simply
don't understand, so I ask - is this the correct behavior? Is it a bug or
by design? I wonder if, possibly, the two values are backwards in the MSDN
documentation...

* Here at work I have a Pentium-4 where Processor.Name gets returned as
"Intel(R) Pentium(R) 4 CPU 2.40GHz", but the Win32_Processor.Family comes
back with a value of 2, or "Unknown". Is there supposed to be a processor
family which maps to the newer Pentium-4 processor? According to the MSDN
docs, a value of 178 is supposed to be Pentium 4. Is it a bug or by design
that the processor family is returned as "Unknown" ? This particular CPU is
a Xeon.

Here is a snippet of the code:

szComputerName = "."
set WMIService_CIMV2 =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & szComputerName &
"\root\cimv2")

set ProcessorSet = WMIService_CIMV2.ExecQuery ("select * from
Win32_Processor")
for each Processor in ProcessorSet
Name = LTrim(Processor.Name)
if (Right(Name, Len(" processor")) = " processor") then Name =
Left(Name, Len(Name) - Len(" processor"))
Family = Processor.Family
WScript.Echo Processor.Name
WScript.Echo Processor.Family
next

set ProcessorSet = Nothing
set WMIService_CIMV2 = Nothing

Thanks,
David Holcomb


 
Reply With Quote
 
 
 
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a
 
      6th Aug 2004
David Holcomb wrote:

> I see some inconsistencies between Win32_Processor.Name and
> Win32_Processor.Family, and I would like to understand if
> this behavior is intentional or a bug in WMI.

Hi

It looks like the Win32_Processor.Family property is not to be trusted,
it does not return correct numbers in many cases (even for old
processor families known when Win2k or WinXP was released).

Some threads about this and some code that uses
Win32_Processor.Description instead to detect CPU family:

http://groups.google.com/groups?thre...%40tkmsftngp11

http://groups.google.com/groups?thre...lea.materna.de

http://groups.google.com/groups?thre...%40tkmsftngp11


For an up-to-date Intel Processor Identification listing that script
examples above uses, take a look here:

http://groups.google.com/groups?selm...TNGP09.phx.gbl



Alternatively, use PSInfo.exe (supports remote computers also).

PSInfo.exe is in the in the free PsTools suite found at
http://www.sysinternals.com/

A VBScript example that picks up the processor type from PSInfo.exe:

'--------------------8<----------------------
Const OpenAsASCII = 0
Const FailIfNotExist = 0
Const ForReading = 1

sExe = "F:\sysinternals\Pstools\Psinfo.exe"

Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTempFile = oShell.ExpandEnvironmentStrings("%TEMP%\") & oFSO.GetTempName

oShell.Run "%comspec% /c " & sExe & " ""Processor type"" -c >" _
& sTempFile, 0, True

Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, _
FailIfNotExist, OpenAsASCII)

sResult = fFile.ReadLine
fFile.Close
oFSO.DeleteFile(sTempFile)

aResult = Split(sResult, ",")
WScript.Echo "Processor type: " & aResult(1)
'--------------------8<----------------------

--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Win32_Processor: WMI: Access denied Kruz Windows XP WMI 2 25th Jan 2006 06:29 AM
root\CIMV2\Win32_Processor Chris Hills Windows XP WMI 10 24th May 2005 01:45 AM
WMI: Win32_Processor Loadpercentage does not return data =?Utf-8?B?TS4gU2NobWl0dA==?= Microsoft Dot NET Framework 0 6th May 2005 05:18 PM
"Win32_Processor: WMI: Access denied" and "Win32_OperatingSystem: WMI: Access denied" Mark Jennings Windows XP WMI 3 29th Dec 2004 05:18 PM
Re: ManagementClass and "Win32_Processor" WMI Class Jochen Kalmbach Microsoft Dot NET Framework 0 24th Aug 2004 07:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:55 AM.