JSI Tip 9153. How can I configure Windows XP, Windows Server 2003, and later to use a system managed page file size?

Using the technique from tip 2733, I have scripted SysPageFile.bat to configure Windows XP and later to use a system managed page file size.

The syntax for using SysPageFile.bat is:

SysPageFile \[L\]

where L is an optional parameter that will only configure the local computer. If you omit the L, all Windows XP computers on the network will be configured.

NOTE: If you want the SysPageFile.bat script to also configure Windows Server 2003 member servers, change "5.1" to "5.1 5.2".

NOTE: A restart is required for the change to become effective.

NOTE: SysPageFile.bat uses NETDOM.EXE, which is installed from the Support Tools folder of your operating system CD-ROM.

SysPageFile.bat contains:

@echo off
set keyxp=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
set key=HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
if  /i "%1" EQU "L" goto lcl
for /f "Skip=1 Tokens=1" %%a in ('netdom query /d:%USERDNSDOMAIN% WORKSTATION^|findstr /I /V /C:"The command completed successfully."') do (
 for /f "Tokens=2*" %%r in ('REG QUERY "\\%%a\%keyxp%" /v CurrentVersion^|find "REG_SZ"^|Findstr "5.1"') do (
 reg add "\\%%a\%key%" /V PagingFiles /T REG_MULTI_SZ /D "C:\pagefile.sys 0 0" /F
goto :EOF
reg add "%key%" /V PagingFiles /T REG_MULTI_SZ /D "C:\pagefile.sys 0 0" /F

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.