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:
wmic pagefileset create name="P:\pagefile.sys" wmic pagefileset where name="P:\\pagefile.sys" set InitialSize=2048,MaximumSize=2048 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:
wmic pagefile list /format:list