Moving the page file on Windows Server 2008 Core

Windows Server 2008 and 2008 R2 use different commands for page file management (here's me thinking WMI was the same across the Server 2008/2008 R2 versions).

To list the state of the page file:

wmic.exe pagefile list /format:list wmic.exe pagefileset list /format:list

Now to move the page file, the environment had a policy to set the pagefile to static:

wmic computersystem where name="COMPUTER_NAME" set AutomaticManagedPagefile=False

This command errored for me, but it looks to be working fine.

A new disk was added for the page file to have exclusive use. To move the page file (sizings are the same as what was on C: drive):

wmic.exe pagefileset create name="P:\pagefile.sys"
wmic.exe pagefileset where name="P:\\pagefile.sys" set InitialSize=5120,MaximumSize=5120
wmic.exe pagefileset where name="C:\\pagefile.sys" delete

Lastly, a quick reboot to make the settings apply:

shutdown –r –t 0

Just to confirm all is set fine:

wmic.exe pagefile list /format:list wmic.exe pagefileset list /format:list

You should see the page file has moved and is sized and the above commands.

About the author

Paul Angus

Paul is a security and infrastructure professional with over 13 years of experience in the Information Technology sector.

Before transitioning to the IT sector, the knowledge gained working along side senior management, civil engineers, surveyors, town planners and graphic designers helped to shape his unique perspective.
Last updated: 
2015-07-05 20:31

Add new comment