Google 그룹스는 더 이상 새로운 유즈넷 게시물 또는 구독을 지원하지 않습니다. 과거의 콘텐츠는 계속 볼 수 있습니다.

how to get win32_processor family value

조회수 65회
읽지 않은 첫 메시지로 건너뛰기

John O'Donnell

읽지 않음,
2002. 7. 19. 오후 12:05:0002. 7. 19.
받는사람
this item returns a number which i need to translate to pentium etc or
whatever

how can i determine what value 2 means?


[MS] Scott McNairy

읽지 않음,
2002. 7. 19. 오후 1:42:3602. 7. 19.
받는사람
You will need to look at the ValueMaps, and Values qualifiers if you want to
do this programatically.

set svc = getObject("winmgmts:Root\cimv2")

' get the object with the wbemuseamendedqualifiers flag
set objCls = svc.Get("win32_processor", 131072)

wscript.echo
objCls.properties_.item("Family").Qualifiers_.item("ValueMap").value(1)
wscript.echo
objCls.properties_.item("Family").Qualifiers_.item("Values").value(1)

This information is also in the documentation for the Win32_Processor class.

--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"John O'Donnell" <csharpco...@hotmail.com> wrote in message
news:eqb384zLCHA.2108@tkmsftngp11...

Torgeir Bakken

읽지 않음,
2002. 7. 20. 오전 2:50:5602. 7. 20.
받는사람
"[MS] Scott McNairy" wrote:

> You will need to look at the ValueMaps, and Values qualifiers if you want to
> do this programatically.
>
> set svc = getObject("winmgmts:Root\cimv2")
>
> ' get the object with the wbemuseamendedqualifiers flag
> set objCls = svc.Get("win32_processor", 131072)
>
> wscript.echo
> objCls.properties_.item("Family").Qualifiers_.item("ValueMap").value(1)
> wscript.echo
> objCls.properties_.item("Family").Qualifiers_.item("Values").value(1)
>
> This information is also in the documentation for the Win32_Processor class.

So my computer is a 8086? I am cheated :( The machine will go straight back to
Dell ;-)

The script below, returns 2 (eq. 8086, see list at bottom) for me on Windows
2000, both on a PIII and P4. Running WinXP on the PIII, I get 17 (M1 family),
but on the P4 I got 2.

Set oWMI = GetObject("winmgmts:")
For Each oCpu in oWMI.InstancesOf("Win32_Processor")
WScript.Echo oCpu.Family
Next


It looks like this property is not to be trusted?

And where is Pentium 4 in the list below?

Fom Win32_Processor
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_processor.asp

Family
Processor family type. This property is inherited from CIM_Processor.

Value Meaning
0 Other
1 Unknown
2 8086
3 80286
4 80386
5 80486
6 8087
7 80287
8 80387
9 80487
10 Pentium Family
11 Pentium Pro
12 Pentium II
13 Pentium MMX
14 Celeron
15 Pentium II Xeon
16 Pentium III
17 M1 Family
18 M2 Family
19 K5 Family
20 K6 Family
21 K6-2
22 K6-III
23 Athlon
24 Power PC Family
25 Power PC 601
26 Power PC 603
27 Power PC 603+
28 Power PC 604
29 Alpha Family
30 MIPS Family
31 SPARC Family
32 68040
33 68xxx Family
34 68000
35 68010
36 68020
37 68030
38 Hobbit Family
39 Weitek
40 PA-RISC Family
41 V30 Family
42 Pentium III Xeon
43 AS400 Family
44 IBM390 Family
45 i860
46 i960
47 SH-3
48 SH-4
49 ARM
50 StrongARM
51 6x86
52 MediaGX
53 MII
54 WinChip

--
torgeir


Torgeir Bakken

읽지 않음,
2002. 7. 20. 오전 3:10:1902. 7. 20.
받는사람
John O'Donnell wrote:

Hi

It is safer to analyze the Win32_Processor.Description I think.

And if you don't want to use WMI, you can substitute that part of the script
with a RegRead from
HKLM\Hardware\Description\System\CentralProcessor\0\Identifier

Select Case CpuID
Case 4
WScript.Echo "Pentium 4"
Case 3
WScript.Echo "Pentium 3"
Case 2
WScript.Echo "Pentium Pro/II or Celeron"
Case 1
WScript.Echo "Pentium or Pentium MMX"
Case Else
WScript.Echo "Unknown CPU type"
End Select


Function CpuID()
' Obtaining CPU identification using WMI
' Script author: Torgeir Bakken

' Function returns a number of type integer:
' 0 ==> Unknown CPU
' 1 ==> Pentium or Pentium MMX
' 2 ==> Pentium Pro/II or Celeron
' 3 ==> Pentium III
' 4 ==> Pentium 4

' based on this table:
' Family Model Type
' 5 < 4 Pentium
' 5 >= 4 Pentium MMX
' 6 < 3 Pentium Pro
' 6 >= 3 < 5 Pentium II
' 6 == 5 Pentium II or Celeron
' 6 == 6 Celeron
' 6 >= 7 Pentium III
'15 >= 0 Pentium 4

' Family 5 and 6 identification based on information from here:
' AP-485 Intel® Processor Identification and the CPUID Instruction
' http://www.intel.com/design/xeon/applnots/241618.htm

Dim oWMI, oCpu, sCpuDescr, aCpuDescr, i, iFamily, iModel, iVersion

Set oWMI = GetObject("winmgmts:")
For Each oCpu in oWMI.InstancesOf("Win32_Processor")

sCpuDescr = oCpu.Description
Next

aCpuDescr = Split(sCpuDescr)
For i = 0 to Ubound(aCpuDescr)
If LCase(aCpuDescr(i)) = "family" Then
iFamily = CInt(aCpuDescr(i+1))
End If
If LCase(aCpuDescr(i)) = "model" Then
iModel = CInt(aCpuDescr(i+1))
End If
Next

iVersion = (iFamily * 100) + iModel

Select Case True
Case iFamily = 5
' Pentium or Pentium MMX
CpuID = 1

Case iVersion < 607
' Pentium Pro/II or Celeron
CpuID = 2

Case iFamily = 6
' Pentium III
CpuID = 3

Case iFamily = 15
' Pentium 4
CpuID = 4

Case Else
' Unknown CPU
CpuID = 0
End Select
End Function

****************************************

The identification is based on information from here:

Intel Processor Identification and the CPUID Instruction
http://www.intel.com/design/Xeon/applnots/24161819.pdf

The original table had binary values for Family Code and Model Number, I have
converted them to decimal values.


Family Code
Model Number
Description
04 00 Intel486? DX processors
04 02 Intel486 SX processors
04 03 Intel487? processors
04 03 IntelDX2? processors
04 03 IntelDX2 OverDrive® processors
04 04 Intel486 SL processor
04 05 IntelSX2? processors
04 07 Write-Back Enhanced IntelDX2 processors
04 08 IntelDX4? processors
04 08 IntelDX4 OverDrive processors
05 01 Pentium® processors (60, 66)
05 02 Pentium processors (75, 90, 100, 120, 133, 150, 166, 200)
05 01 Pentium OverDrive processor for Pentium processor (60, 66)
05 02 Pentium OverDrive processor for Pentium processor
(75, 90, 100, 120, 133)
05 03 Pentium OverDrive processors for Intel486 processors
05 04 Pentium processor with MMX? technology (166, 200)
05 04 Pentium OverDrive processor with MMX? technology for
Pentium processor (75, 90, 100, 120, 133)
06 01 Pentium Pro processor
06 03 Pentium II processor, model 3
06 05 Pentium II processor, model 5, Pentium II Xeon processor,
model 5, and Intel Celeron processor, model 5. Note(5)
06 06 Intel Celeron processor, model 6
06 07 Pentium III processor, model 7, and Pentium III Xeon processor,
model 7. Note(6)
06 08 Pentium III processor, model 8, Pentium III Xeon processor,
model 8, and Intel Celeron processor, model 8. Note(7)
06 10 Pentium III Xeon processor, model A
06 11 Pentium III processor, model B
06 03 Intel Pentium II OverDrive processor
15 xx Intel Pentium 4 processor or Intel Xeon processor


Note:
5. To differentiate between the Pentium II processor, model 5, Pentium II Xeon
processor and the Intel Celeron processor, model 5, software should check the
cache descriptor values through executing CPUID instruction with EAX = 2. If no
L2 cache is returned, the processor is identified as an Intel Celeron processor,
model 5. If 1M or 2M L2 cache size is reported, the processor is the Pentium II
Xeon processor otherwise it is a Pentium II processor, model 5 or a Pentium II
Xeon processor with 512K L2 cache size.

6. To differentiate between the Pentium III processor, model 7 and the Pentium
III Xeon processor, model 7, software should check the cache descriptor values
through executing CPUID instruction with EAX = 2. If 1M or 2M L2 cache size is
reported, the processor is the Pentium III Xeon processor otherwise it is a
Pentium III processor or a Pentium III Xeon processor with 512K L2 cache size.

7. To differentiate between the Pentium III processor, model 8 and the Pentium
III Xeon processor, model 8, software should check the Brand ID values through
executing CPUID instruction with EAX = 1.


--
torgeir


alex_k._angelopoulos_(mvp)

읽지 않음,
2002. 7. 21. 오전 7:16:1402. 7. 21.
받는사람
"Torgeir Bakken" <Torgeir...@hydro.com> wrote in message
news:3D390CDB...@hydro.com...
> John O'Donnell wrote:
> Function CpuID()
> End Function

Torgeir, I did the full set from the latest SDK this morning. Here's my
conversion in a function in case you want it. It would make that thing
into a definite scroll-to-read, though... ;-)

Function CpuIdToName(iData)
Select Case iData
Case 0 CpuIdToName = "Other"
Case 1 CpuIdToName = "Unknown"
Case 2 CpuIdToName = "8086"
Case 3 CpuIdToName = "80286"
Case 4 CpuIdToName = "80386"
Case 5 CpuIdToName = "80486"
Case 6 CpuIdToName = "8087"
Case 7 CpuIdToName = "80287"
Case 8 CpuIdToName = "80387"
Case 9 CpuIdToName = "80487"
Case 10 CpuIdToName = "Pentium Family"
Case 11 CpuIdToName = "Pentium Pro"
Case 12 CpuIdToName = "Pentium II"
Case 13 CpuIdToName = "Pentium MMX"
Case 14 CpuIdToName = "Celeron"
Case 15 CpuIdToName = "Pentium Xeon"
Case 16 CpuIdToName = "Pentium III"
Case 17 CpuIdToName = "M1 Family"
Case 18 CpuIdToName = "M2 Family"
Case 19 CpuIdToName = "K5 Family"
Case 20 CpuIdToName = "K6 Family"
Case 21 CpuIdToName = "K6-2"
Case 22 CpuIdToName = "K6-III"
Case 23 CpuIdToName = "Athlon"
Case 24 CpuIdToName = "Power PC Family"
Case 25 CpuIdToName = "Power PC 601"
Case 26 CpuIdToName = "Power PC 603"
Case 27 CpuIdToName = "Power PC 603+"
Case 28 CpuIdToName = "Power PC 604"
Case 29 CpuIdToName = "Alpha Family"
Case 30 CpuIdToName = "MIPS Family"
Case 31 CpuIdToName = "SPARC Family"
Case 32 CpuIdToName = "68040"
Case 33 CpuIdToName = "68xxx Family"
Case 34 CpuIdToName = "68000"
Case 35 CpuIdToName = "68010"
Case 36 CpuIdToName = "68020"
Case 37 CpuIdToName = "68030"
Case 38 CpuIdToName = "Hobbit Family"
Case 39 CpuIdToName = "Weitek"
Case 40 CpuIdToName = "PA-RISC Family"
Case 41 CpuIdToName = "V30 Family"
Case 42 CpuIdToName = "Pentium Xeon"
Case 43 CpuIdToName = "AS400 Family"
Case 44 CpuIdToName = "IBM390 Family"
Case 45 CpuIdToName = "i860"
Case 46 CpuIdToName = "i960"
Case 47 CpuIdToName = "SH-3"
Case 48 CpuIdToName = "SH-4"
Case 49 CpuIdToName = "ARM"
Case 50 CpuIdToName = "StrongARM"
Case 51 CpuIdToName = "6x86"
Case 52 CpuIdToName = "MediaGX"
Case 53 CpuIdToName = "MII"
Case 54 CpuIdToName = "WinChip"
Case Else CpuIdToName = "Not in list - #" & iData
End Select
End Function


alex_k._angelopoulos_(mvp)

읽지 않음,
2002. 7. 21. 오후 9:12:3502. 7. 21.
받는사람
Scratch this. As noted in the thread "Finding the Processor Type" in
.wsh, this appears to return bogus results.

--
Please respond in the newsgroup. I've still got unread email from the
week Win95 was released, if that tells you anything.
http://www.bittnet.com/winremote
http://www.bittnet.com/scripting


<Alex K. Angelopoulos (MVP)> wrote in message
news:eHocHfKMCHA.1928@tkmsftngp13...

[MS] Scott McNairy

읽지 않음,
2002. 7. 22. 오후 1:59:4902. 7. 22.
받는사람
This is another bug that has been fixed in Windows XP. Since P4's didn't
exist when Win2k was released it was untested against P4's, so instead of
guessing we returned Unknown.

--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

<Alex K. Angelopoulos (MVP)> wrote in message

news:OMlYdyRMCHA.2748@tkmsftngp13...

VM

읽지 않음,
2002. 7. 24. 오후 11:04:3402. 7. 24.
받는사람
> The script below, returns 2 (eq. 8086, see list at bottom) for me on
Windows
> 2000, both on a PIII and P4. Running WinXP on the PIII, I get 17 (M1
family),
> but on the P4 I got 2.

2 does not mean "8086" but "Unknown". PIII was "unknown" at the time Win2000
was released, as much as P4 was when XP was released.

Just the same, 17 is not "M1 Family" but "Pentium III".

As Scott said, you shouln't trust the MSDN page, but the Values and ValueMap
qualifiers.

Here's an unoptimized WSH/JScript (sorry, my VBScript is kindda rusty :)

var oLoc = new ActiveXObject("WbemScripting.SWbemLocator");
var oSvc = oLoc.ConnectServer(null, "root\\cimv2");

// get the Win32_processor class using amended qualifiers
var oClsProc = oSvc.Get("Win32_Processor", 0x20000);

// get the QualifierSet object
var oQualSet = oClsProc.Properties_.item("Family").Qualifiers_;

// get the "Values" array
var oValues = new VBArray(oQualSet.item("Values").Value).toArray();

// get the "ValueMap" array
var oValueMap = new VBArray(oQualSet.item("ValueMap").Value).toArray();

/* Uncomment this block if you need the full list

for(i = 0; i < oValues.length; i++)
{
WScript.Echo(oValueMap[i] + "\t" + oValues[i]);
}
WScript.Echo();
*/

var oInstProc = oSvc.Get("Win32_Processor.DeviceID=\"CPU0\"");

for(i = 0; i < oValueMap.length; i++)
{
if(oInstProc.Family == oValueMap[i]) // look for a match
{
WScript.Echo("CPU0 is:\t" + oValueMap[i] + "\t" + oValues[i]);
break;
}
}

Hope it helps.

새 메시지 0개