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