Fix: Description = Invalid query When Changing Page File Location in Windows Server 2008 R2 Core
I’m preparing a Hyper-V two-nodes cluster where to create a test environment of our current Active-Directory domain for DC upgrades to Windows Server 2008 R2 simulation scenarios. To keep resources for child partitions I have installed Windows Server 2008 R2 Enterprise Core edition as base OS on the nodes. One of the common tasks I use to run after the base installation is tuning the virtual memory and moving the page file to a dedicated partition to avoid fragmentation.
The method described in Microsoft’s article Administering a Server Core installation; and in several blogs around like Server Core - Move that Swap/Page File didn’t helped me so much; sometimes a there was a missing command, some are omitting steps; and always I was getting the Description = Invalid query error code when executing the following command:
wmic pagefileset where name=”[path/filename]” set InitialSize=[initialsize],MaximumSize=[maxsize]
So, if you are on the same situation as me, simply follow this steps which worked like a charm for me:
-
First of all check your settings by executing the following commands:
wmic.exe pagefile list /format:list (to see system’s page file when automatically managed)
wmic.exe pagefileset list /format:list (to see your defined page files when manually managed) -
Deactivate the automatic page file management by executing the following command:
**wmic.exe computersystem set AutomaticManagedPagefile=False
** -
Create the page file in destination partition, by executing:
**wmic.exe pagefileset create name=“D:\pagefile.sys”
** -
At this point you need to delete the old page file prior to set InitialSize and MaximumSize values for the new one, so execute:
**wmic.exe pagefileset where name=“C:\\pagefile.sys” delete
** -
Now you just have your new page file and now you can execute the following to set your values to your needs:
**wmic.exe pagefileset set InitialSize=9192,MaximumSize=9192
** -
Reboot your server.
Shutdown /r /t 0
I recommend you to set Initial and Maximum value to the same value to avoid I/O activity while extending the page file. So, after all your page file configuration should looks like the following one: