none
How to change page file size and location from command line during setup? RRS feed

  • Question

  • Hello,

    We would like to know how to change the size and location of the pagefile file of Windows 7.

    In XP we had the "changepagefile.vbs" script but it doesn't work with Windows 7.

    We need to deploy a Win 7 image and have the unattend.xml execute a script for changing the size of the pagefile (have a fixed size) and the location (basically so old Oracle installers can continue because they see the pagefile memory).

    Any idea, command or tweak for changing the pagefile? I've googled a lot but I've not found anything.

    Thank you.

     

    Monday, September 27, 2010 2:45 PM

Answers

  • Hi,

    To change the page file size from command line, enter the line below (adapt the location and size)

    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

    then restart your computer

    regards,


    Blog Microsoft | Déployer Windows 7 | Améliorer les performances de Windows 7
    Monday, September 27, 2010 5:41 PM
  • Umm ...

    I've used RegFromApp to "scan" changes in the registry by the AdvancedProperties program and I've found that it changes the "PagingFiles" key in the registry.

    So, I've executed the following:

    reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v PagingFiles /t REG_MULTI_SZ /d "d:\pagefile.sys 2048 2048" /

    restarted Windows, and voilà, the pagefile in c:\ is gone, and a new one is created in the D:\ drive.

    Easy.

     

     

    Monday, September 27, 2010 3:30 PM

All replies

  • Umm ...

    I've used RegFromApp to "scan" changes in the registry by the AdvancedProperties program and I've found that it changes the "PagingFiles" key in the registry.

    So, I've executed the following:

    reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v PagingFiles /t REG_MULTI_SZ /d "d:\pagefile.sys 2048 2048" /

    restarted Windows, and voilà, the pagefile in c:\ is gone, and a new one is created in the D:\ drive.

    Easy.

     

     

    Monday, September 27, 2010 3:30 PM
  • Hi,

    To change the page file size from command line, enter the line below (adapt the location and size)

    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

    then restart your computer

    regards,


    Blog Microsoft | Déployer Windows 7 | Améliorer les performances de Windows 7
    Monday, September 27, 2010 5:41 PM
  • Thanks for this Manel ! have been looking for this !! Works like a Charm !
    Monday, May 8, 2017 6:08 PM
  • The wmic pagefileset doesn't work in Windows 10...
    Thursday, January 10, 2019 9:15 AM
  • I didn't have an issue with the command line in Server 2019.  It didn't seem to like the extension for the list /format:list, but I may have fat-fingered it. The shorter command worked just fine though.

    My issue is that I set this and it shows in WMIC and the registry location mentioned above, but it does not show in the GUI. Also, if I set it in the GUI, it doesn't show in WMIC.  Very strange.

    Check your typing. It does still seem to work in later OS's. It didn't seem to like my use of the D: drive, but C: worked without issue.

    Good luck!


    I'm werkin' on it...

    Thursday, January 10, 2019 3:10 PM
  • try typing this command on Windows 10:

    wmic pagefile list /format:list

    you should get something like this below:

    AllocatedBaseSize=2304
    CurrentUsage=299
    Description=C:\pagefile.sys
    InstallDate=20190509010210.390116-240
    Name=C:\pagefile.sys
    PeakUsage=386
    Status=
    TempPageFile=FALSE



    • Edited by MasterY0da Wednesday, November 13, 2019 5:23 PM
    Wednesday, November 13, 2019 5:23 PM
  • R.click my computer/properties/Advanced/Virtual memory/Advanced/Change button.Highlite C: set to: Let System Manage/click set 2X/exit restart pc.This works for all HDs even USB flash once enabled in: diskmgmt.msc

    One can also edit the page-file,by run: type:  regedit/HKEY_LOCAL_MACHINE/SYSTEM/CURRENT CONTROLSET/Control/Sessionmgr/memory mangmt/locate: Disable Page executive/L.click go up to EDIT/set to 1 from 0 Also,one can L.click on ClearPageFile @ shutdown,edit,set to 1 from 0 this clears the page-file/virtual memory at desktop shutdown/restart.These are Intel/TechNet performance settings.

    Wednesday, November 13, 2019 10:42 PM