; autoit中文论坛 http://www.autoitx.com
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$Output=""
$Output = $Output & "Computer: " & $strComputer & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PageFileSetting", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$objItem.InitialSize = 1500 ;初始大小(MB)
$objItem.MaximumSize = 3000 ;最大值(MB)
$objItem.Put_
Next
Else
Msgbox(0,"WMI 输出","你确认你的WMI服务开启了?或者没有找到WMI对象: " & "Win32_PageFileSetting" )
Endif
要删除将最小值和最大值设为0,就可以了。 |