Enable+disable pagefile.sys in registry?

Discussion in 'Windows 7 Installation' started by pstein, Aug 8, 2015.

  1. pstein

    pstein Honorable Member

    Mar 20, 2010
    Likes Received:
    Is there a way NOT to enable + disable Pagefile.sys through Systems dialog but with a Registry key?

    When enabling from disbaled state it should take the previously (eventually in the past) set partition location and file size.

    If this is not possible then pagefile.sys should be set to "system managed".

    Be aware: I am NOT talking about just a deletion of pagefile.sys at shutdown but a complete disabling!

  2. Josephur

    Josephur Windows Forum Admin
    Staff Member Premium Supporter

    Aug 3, 2010
    Likes Received:
    Registry key wouldn't do you too well as you often need to reboot when adjusting page file settings for them to take effect.

    You can however invoke WMI to manage it from the command line using WMIC. This should be done at an administrative command prompt, once you get it figured out you could quickly create a few batch files to do your pagefile bidding.

    To query for current settings:
    wmic pagefile list /format:list

    To create a new page file:
    wmic pagefileset create name="C:\pagefile.sys"
    wmic pagefileset where name="C:\pagefile.sys" set InitialSize=4096,MaximumSize=4096
    wmic pagefileset where name="C:\pagefile.sys" delete

    You will also want to look at the pagefileset DELETE command for your needs.

    To get help type wmic COMMAND /? for instance, wmic pagefile /?
    #2 Josephur, Aug 8, 2015
    Last edited: Sep 2, 2015
    ussnorway likes this.
  3. ussnorway

    ussnorway Windows Forum Team
    Staff Member Premium Supporter

    May 22, 2012
    Likes Received:
    Fyi you can also share a pagefile across many systems on a dual/multi-boot computer but to be clear Windows is designed to run with a pagefile and expects there is one when doing tasks... having no page file can bugger up some error logging senarios and I don't recommend it for most people.

Share This Page