vbscript
:
читать дальше »
Код:

Option Explicit
Dim strComputer
Dim objSWbemLocator
Dim objSWbemServicesEx
Dim objSWbemObjectEx
strComputer = "."
Set objSWbemLocator = WScript.CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServicesEx = objSWbemLocator.ConnectServer(strComputer, "root\cimv2")
objSWbemServicesEx.Security_.Privileges.AddAsString "SeCreatePagefilePrivilege", True
For Each objSWbemObjectEx In objSWbemServicesEx.InstancesOf("Win32_ComputerSystem")
With objSWbemObjectEx
' Раскомментировать для Vista и выше:
'.AutomaticManagedPagefile = False
'.Put_
End With
Next
For Each objSWbemObjectEx In objSWbemServicesEx.InstancesOf("Win32_PageFileSetting")
objSWbemObjectEx.Delete_
Next
Set objSWbemObjectEx = Nothing
Set objSWbemServicesEx = Nothing
Set objSWbemLocator = Nothing
WScript.Quit 0
А также на XP есть «pagefileconfig.vbs»:
Код:

C:\WINDOWS\system32\pagefileconfig.vbs /?