I've been working on getting a script created that will set the pagefile settings on all our workstations. Workstations are Win 2K SP4 and Win XP SP2. Current company policy: no pagefile on C: and a pagefile set on D: (1.5 * physical memory); min and max are the same. We have successfully set the C: (boot) pagefile to zero manually, so I don't see a reason why we can't do this via a script. I have a script that will find the physical memory and set the page file size accordingly, but I need it to also do the following:
If the pagefile is found on the C: partition, remove from C: and create on D: partition
Max out at 4GB for the pagefile size
I work weekdays, so if I don't get the answer today, I'll be back Monday.
This is what I have so far:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colCSItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
Set colPageFiles = objWMIService.ExecQuery _
("Select * from Win32_PageFileSetting")
For Each objPageFile in colPageFiles
For Each objCSItem In colCSItems
objPageFile.InitialSize = objCSItem.TotalPhysicalMemory * 1.5 / 1048576
objPageFile.MaximumSize = objCSItem.TotalPhysicalMemory * 1.5 / 1048576