Pular para o conteúdo

Script to Change the Page File in Windows 2008 Server Core

04/30/2012

It is very common to install Windows 2008 Core mode forget the size that the paging file will stay.

Normally it will create a paging file with the same size of memory, which hosts with 128 GB will leave a server (which typically has 160 GB disks) with the OS disk almost full.

It’s simple to change the Page File by using the script below which you can copy to a cmd file and run.

wmic pagefile list /format:list
pause
wmic computersystem where name=”%computername%” set AutomaticManagedPagefile=False
wmic pagefileset where name=”C:\\pagefile.sys” set InitialSize=16384,MaximumSize=16384
pause
shutdown -r -t 0

Line-by-line explanation follows:

  1. Lists the current settings, only for the check line 4, note the line parameter Name
  2. Pause to cancel and modify the line 4 if necessary
  3. Deactivates the Auto mode (default) and manual leaves
  4. Changes the paging file to 16 GB, so you can use other size that may be deemed necessary
  5. Pause before the shutdown to check if there are error messages
  6. Restart the server immediately

From → Windows

3 Comentários
  1. Hi,
    can you help me to move the page file to H drive and set the pagefile as 1.5 times Ram of the computer?

  2. Hi Eswar,

    You need set pagefile for drive C: to 0 and set drive H:
    I dont have a command or parameter to read physical memory to set automatically size.

    Regards.

  3. Luca permalink

    Sorry for who love command line..
    Run sysdm.cpl
    BR

Deixar mensagem para Luca Cancelar resposta