Windows Core: Move Page File via PowerShell

Reading Time: < 1 minute

You have configured a Windows Core Server and the page file resides on disk C. You would like to move it to Disk P

Run the below commands one at a time. If copying and pasting the commands, you may need to reenter the ” if any of the commands error.
Also, if you receive Description = Invalid query when running command 2, please reboot your server and run all commands again.
1)
wmic computersystem set AutomaticManagedPagefile=False

2)
wmic pagefileset where name=”C:\\pagefile.sys” delete

3)
wmic pagefileset create name=”P:\pagefile.sys”

4) Amend the InitialSize and MaximumSize figures as required. This command is based on a server including 4GB of memory. If your server includes 4GB of memory, it’s fine to use the below command:

wmic pagefileset where name=”P:\\pagefile.sys” set InitialSize=6144,MaximumSize=6144

5) Reboot the server

6) Run below command to confirm location of your page file
wmic pagefile list /format:list

How useful was this post?

Click on a star to rate it!

As you found this post useful...

Follow us on social media!

One thought on “Windows Core: Move Page File via PowerShell

  1. This is particularly useful if you use [ Dell/EMC BOSS (Boot Optimized Storage) – RAID-1 ] and/or [ Cisco UCS Boot Optimized NVMe RAID-1 ] and you want to preserve the life of those NVMe drives.

    Conversely, it may be recommended for Hyper-V standalone hypervisors running on Windows Core/NDE, to use/specify a second non-Boot NVMe RAID volume optimal location for the swap of the Supervisor Windows Kernel and/or the Guest VMs.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.