The code below will display the pagefile min and max size as well as the total physical memory size. I need to set the min and max to equal 1.5 * physical memory size so that when the computer reboots, it retains the new settings.
Any help would be greatly appreciated! = )
'*************************
strComputer = "."
PageFile
MemCount
CreatePageFileSize
Sub PageFile()
On Error Resume Next
Set objWMIServicePageFile = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"
Set colItems1 = objWMIServicePageFile.ExecQuery("Select * from Win32_PageFileSetting",,48)
For Each objItem in colItems1
Wscript.Echo "InitialSize: " & objItem.InitialSize
Wscript.Echo "MaximumSize: " & objItem.MaximumSize
Next
End Sub
Sub MemCount()
On Error Resume Next
Set objWMIServicePhysMem = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"
Set colItems2 = objWMIServicePhysMem.ExecQuery("Select * from Win32_ComputerSystem",,48)
For Each objItem in colItems2
Wscript.Echo "Total Physical Memory: " & objItem.TotalPhysicalMemory
Next
Any help would be greatly appreciated! = )
'*************************
strComputer = "."
PageFile
MemCount
CreatePageFileSize
Sub PageFile()
On Error Resume Next
Set objWMIServicePageFile = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"

Set colItems1 = objWMIServicePageFile.ExecQuery("Select * from Win32_PageFileSetting",,48)
For Each objItem in colItems1
Wscript.Echo "InitialSize: " & objItem.InitialSize
Wscript.Echo "MaximumSize: " & objItem.MaximumSize
Next
End Sub
Sub MemCount()
On Error Resume Next
Set objWMIServicePhysMem = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"

Set colItems2 = objWMIServicePhysMem.ExecQuery("Select * from Win32_ComputerSystem",,48)
For Each objItem in colItems2
Wscript.Echo "Total Physical Memory: " & objItem.TotalPhysicalMemory
Next