_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › CPU覲伎企Cscript
|
|
[edit]
1 cscript #Dim objWMIService, colItems, objItem, strComputer, intSocketsTotal, strSocketsAll Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20 strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) strSocketsAll = "" intSocketsTotal = 0 For Each objItem In colItems Wscript.Echo "Socket Name: " & objItem.SocketDesignation If Instr(strSocketsAll, objItem.SocketDesignation) = 0 Then intSocketsTotal = intSocketsTotal + 1 strSocketsAll = strSocketsAll & objItem.SocketDesignation End If Next WScript.Echo "Socket Count: " & intSocketsTotal set wmi_service = GetObject("winmgmts:\\" & server_name) set wmi_objectset = wmi_service.InstancesOf("Win32_Processor") for each wmi_object in wmi_objectset wscript.echo "Clock Speed: " & cstr(wmi_object.MaxClockSpeed) & " GHz" wscript.echo "Core Count: " & cstr(wmi_object.NumberOfCores) next set wmi_service = nothing ろ
C:\>cscript cpucount2.vbs Microsoft (R) Windows Script Host 覯 5.7 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Socket Name: Socket 775 Socket Count: 1 Clock Speed: 2400 GHz Core Count: 4
[edit]
2 sql #SELECT [value_in_use] AS [MAXDOP], os.* FROM sys.configurations, (SELECT COUNT (DISTINCT [parent_node_id]) AS [Nodes], COUNT (*) AS [Cores] FROM sys.dm_os_schedulers WHERE [status] = 'VISIBLE ONLINE') AS os WHERE [name] = 'max degree of parallelism'; GO [edit]
3 危 磯(hyper-threading) 瑚讌 #wmic path Win32_processor get NumberOfCores, NumberOfLogicalProcessors 蟆郁骸: hyper threading enable 蟆曙
D:\>wmic path Win32_processor get NumberOfCores, NumberOfLogicalProcessors NumberOfCores NumberOfLogicalProcessors 4 8 D:\> cmd
wmic wmic shell(?)..
wmic:root\cli> CPU Get NumberOfCores,NumberOfLogicalProcessors /Format:List
鏤
|
語 蟲レ. 語 螳 螳れ 谿曙朱 碁螻 給. (R.襦る) |