Answered by:
Command for changeing the page file

Question
-
Thursday, December 27, 2007 5:24 AM
Answers
-
By default Windows Server Core will have an automatically managed page file. This makes perfect sense since Server Core will not be able to show error messages when you run out of the page file. The automatically managed pagefile will adjust in size to correct problems that might arise.
When you want to change your page file settings you need to first turn the automatic pagefile off and after that make a new pagefile with your own defined settings. In the Windows Management Instrumentation (WMI) the automatic pagefile and the set page file have different aliasses:
-
The automatically managed pagefile can be 'managed' through the pagefile alias. Since everything is managed automatically there's only a view command you can use in the following way:
wmic pagefile or wmic pagefile list /format:list
(I prefer the last one since it has output in a more humanly viewable format)
-
The selfmanaged pagefile can be managed through the pagefileset alias. Before you can set a pagefile however, you need to disable the automatic pagefile. The command for this is:
wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False
After that you can use the pagefileset command to set a pagefile, to create a pagefile, to delete a pagefile... basically all the stuff you want to do with a pagefile. For instance: to create a pagefile to replace the C:\pagefile.sys with a fixed size of 2048 Megabyte, (I don't know why the Step-by-Step guide mentions bytes... the command obviously measures in MegaBytes) simply type:
wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=2048,MaximumSize=2048
-
After setting the pagefile yourself, you can check its settings with:
wmic pagefileset or wmic pagefileset list /format:list
(Obviously I prefer the latter one again) -
To make the settings take effect you need to reboot your Server Core box.
I hope this helps.
Thursday, December 27, 2007 12:29 PM -
All replies
-
Most of this is documented in the Windows Server 2008 Server Core Step-by-Step guide:
Step-byStep Guide wrote: Disabling Paging file management
At a command prompt, type:
wmic computersystem where name="<computername>" set AutomaticManagedPagefile=False
Configure the paging file
At a command prompt, type:
wmic pagefileset where name=”<path/filename>” set InitialSize=<initialsize>,MaximumSize=<maxsize>
Where:
path/filename is the path to and name of the paging file
initialsize is the starting size of the paging file in bytes.
maxsize is the maximum size of the page file in bytes.
To view the Page file settings I prefer to use the following command:
(which is not in the Step-by-Step guide)
wmic pagefile list /format:list
wmic pagefileset list /format:list
Please note:
In Windows Server 2008 up to Beta 3 you can use SCregEdit.wsf /PF to change Page file settings. In recent versions of Windows Server 2008 the /PF switch has been deprecated.
Thursday, December 27, 2007 8:33 AM
Hi ,
pagefileset create c:\pagefile.sys set initialsize=109051904000,maximumsize=109051904000
I have the above command but it is throwing the below error messages.
Invalid format.
Hint: <assignlist> = <propertyname>=<propertyvalue> [, <assignlist>].
Can i access using MMC or GUI of server core and then change
By default Windows Server Core will have an automatically managed page file. This makes perfect sense since Server Core will not be able to show error messages when you run out of the page file. The automatically managed pagefile will adjust in size to correct problems that might arise.
When you want to change your page file settings you need to first turn the automatic pagefile off and after that make a new pagefile with your own defined settings. In the Windows Management Instrumentation (WMI) the automatic pagefile and the set page file have different aliasses:
-
The automatically managed pagefile can be 'managed' through the pagefile alias. Since everything is managed automatically there's only a view command you can use in the following way:
wmic pagefile or wmic pagefile list /format:list
(I prefer the last one since it has output in a more humanly viewable format)
-
The selfmanaged pagefile can be managed through the pagefileset alias. Before you can set a pagefile however, you need to disable the automatic pagefile. The command for this is:
wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False
After that you can use the pagefileset command to set a pagefile, to create a pagefile, to delete a pagefile... basically all the stuff you want to do with a pagefile. For instance: to create a pagefile to replace the C:\pagefile.sys with a fixed size of 2048 Megabyte, (I don't know why the Step-by-Step guide mentions bytes... the command obviously measures in MegaBytes) simply type:
wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=2048,MaximumSize=2048
-
After setting the pagefile yourself, you can check its settings with:
wmic pagefileset or wmic pagefileset list /format:list
(Obviously I prefer the latter one again) -
To make the settings take effect you need to reboot your Server Core box.
I hope this helps.
Thanks for the syntax to run the set on another volume. Technet had the syntax as "path/filename" which was WRONG.
Here is the setpagefile batch file I use to adjust remotely:
REM ::setpagefile.bat::
@echo off
set /p server="Which server or '@serverlist.txt?' ":
set /p logon="Which user to logon with? ":
set /p StartSize="What InitialSize do you want on the pagefile? ":
set /p MaxSize="What MaximumSize do you want on the pagefile? ":
set /p pathfilename="What volume:\\path\filename? (i.e. C:\\pagefile.sys)
REM wmic pagefileset where name="<path/filename>" set InitialSize=<initialsize>,MaximumSize=<maxsize> //wrong
REM wmic pagefileset where name="<volume:\\path\filename>" set InitialSize=<initialsize>,MaximumSize=<maxsize> //right
wmic /user:usirmc\%logon% /node:%server% pagefileset where name="%pathfilename%" set InitialSize=%StartSize%,MaximumSize=%MaxSize%
set server=
set logon=
set StartSize=
set MaxSize=
set pathfilename=
Patrick Burwell, VP, iQor, Inc.
Is is possible to make the page file custom without rebooting the server?
thanks.
This is what I did in my batch file for setting up the page file with Initial size of 150% physical memory and double for maximum size.
REM -------------------------------------------------------------------------------------------------------
REM GET THE PHYSICAL MEM SIZE AS DIGITS
REM --------------------------------------------------------------------------------------------------------
FOR /F "eol=; tokens=1,2,3,4,5 delims=:, " %%i IN ('"systeminfo |find /i "Total Phy""') DO @Set /a m=%%l%%m
REM -------------------------------------------------------------------------------------------------------
REM SET INITIAL MEMORY SIZE 150%of PHYSICAL MEMORY
REM --------------------------------------------------------------------------------------------------------
set /a x=%m%*3/2
REM -------------------------------------------------------------------------------------------------------
REM SET MAXIMUM MEMORY 200% OF PHYSICAL MEMORY
REM --------------------------------------------------------------------------------------------------------
set /a y=%m%*2
REM -------------------------------------------------------------------------------------------------------
REM CHANGE PAGE FILE TO MANUAL
REM --------------------------------------------------------------------------------------------------------
wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False
REM -------------------------------------------------------------------------------------------------------
REM SET PAGEFILE SIZE
REM --------------------------------------------------------------------------------------------------------
wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=%x%,MaximumSize=%y%
- Proposed as answer by sayyed.jafar Sunday, April 24, 2011 7:34 AM
Hi,
I need to disable pagefile for our Windows 7 deployment, from what I understand WAIK doesn't have the ability to disable pagefile.
I was wondering if it is possible to disable pagefile completely using wmic?