Here is a VBScript that we use to set the pagefile on desktop/laptop systems when we are building them in Deployment Solution.
This will figure out the amount of physical RAM in the system, then set the initial and maximum size to 1.5 times the physical RAM. It will set a maximum of 4gb. It doesn't change the drive that contains the page file since this is specifically directed toward our desktop/laptop systems.
Download the VBScript.txt and save it as setpagefile.vbs to a share on your network, then create a job in Deployment Solution to run the VBScript following these screen shots.
Right click on job folder to create a “New Job”
Click to view.
Add a “Run Script” task to the job
Type the location of the VBScript in “Run the script from file:”
You may have to specify a user that has rights to the share
Click Finish
Add a reboot (Power Control) for this to take effect
Select Restart (we always select force applications…) and click finish.
The result should be a job with two tasks.
Hi pcalver,
The attached vbscript works perfectly on Windows XP. However, it fails on Windows 7.
Is there any other script that will work on Windows 7?
Thanks!
Make its initial size as big as the maximum size. Although this will cause the Pagefile to occupy more HD space, we do not want it to start off small, then having to constantly grow on the HD. Writing large files (and the Pagefile is indeed large) to the HD will cause a lot of disk activity that will cause performance degradation. Also, since the Pagefile only grows in increments, you will probably cause Pagefile fragmentation, adding more overhead to the already stressed HD. System managed does the following: ...minimum size is equivalent to 1.5 times the amount of RAM on your system, and 3 times that figure for the maximum size.
Why not just set the control of the page file to system managed? This will then set the size of the page file AUTOMATICALLY to 1.5 times the installed RAM, and the figure will automatically change if you add or remove RAM in the future. The following regkey sets the page file size to system managed:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management] "PagingFiles"=hex(7):43,00,3a,00,5c,00,70,00,61,00,67,00,65,00,66,00,69,00,6c,\ 00,65,00,2e,00,73,00,79,00,73,00,20,00,30,00,20,00,30,00,00,00,00,00