AU3 识别物理内存

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compile_both=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Global $objwmiservice, $wnc, $mem1, $mem3
Local $object, $objoperatingsystem

$objwmiservice = ObjGet("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
$wnc = $objwmiservice.execquery("select * from win32_physicalmemory")

For $object In $wnc
	$mem = String(Int($object.capacity / 1048576))
	If $mem1 = "" Then
		$mem1 = $mem & "MB"
		$mem2 = ""
	Else
		$mem1 &= "/" & $mem & "MB"
		$mem2 = "(" & $mem1 & ")"
	EndIf
	$mem3 += $mem
Next
$nc = $mem3 & $mem2 & "MB"
MsgBox(32, "", $nc)

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据