|
请教各位大老:为什么WMI在WIN2K下无法运行,WMI-SDK 1.50(wmicore.EXE)在WIN2K下也无法安装,WIN2K中的Windows Management Instrumentation和Windows Management Instrumentation Driver Extensions服务都已经启动????
Func _GetMemorySize()
Local $PhysicalMemory = " "
Local $colItems, $objWMIService, $objItem
Local $wbemFlagReturnImmediately = 0x10 , $wbemFlagForwardOnly = 0x20
$objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMemory", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) Then
For $objPhysicalMemory In $colItems
$PhysicalMemory = $objPhysicalMemory.Capacity
If $PhysicalMemory = " " Then ExitLoop
Return Int($PhysicalMemory / (1024 * 1024)) & " MBytes"
Next
EndIf
Return "Unknown"
EndFunc |
|