Q: How can I change the pagefile configuration from the command line?

A: This is very useful on Server Core systems where no graphical interface is required. Here I create a new pagefile on the P: volume and delete the old pagefile:

  1. wmic pagefileset create name="P:\pagefile.sys"
  2.  
  3. wmic pagefileset where name="P:\\pagefile.sys" set InitialSize=2048,MaximumSize=2048
  4.  
  5. wmic pagefileset where name="C:\\pagefile.sys" delete

Reboot the machine for the change to take effect. To list the pagefiles, use the command below:

  1. wmic pagefile list /format:list