Increase PageFile through command line without a reboot.

Welcome Forums General PowerShell Q&A Increase PageFile through command line without a reboot.

This topic contains 1 reply, has 2 voices, and was last updated by

2 years, 2 months ago.

  • Author
  • #55954

    Points: 0
    Rank: Member


    I need to increase the pagefile size on a system using a command line on the fly. There are 2 options using which I can set it:

    1. wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=1450,MaximumSize=1450
    2. REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v PagingFiles /t REG_MULTI_SZ /d "D:\pagefile.sys " /f

    Both the above mentioned methods work and show the changes in the registry. However, it does not change the actual size of the pagefile on the disk until a restart. Not does it show the updated value when checking using "Get-CimInstance Win32_PageFileUsage | fl *" command.

    Ideally, an increase in the page file size from the GUI does not need a reboot, when click on "Set" option.

    Is there a way to refresh the pagefile size after it has been increased in the registry, without rebooting the system?

    Any help will be highly appreciated!

  • #56005

    Points: 1,785
    Helping HandTeam Member
    Rank: Community Hero

    Not that I'm aware of. The GUI calls some fairly low-level APIs to make that happen, as it's an activity – processes have to be suspended, etc. It isn't just changing a configuration.

The topic ‘Increase PageFile through command line without a reboot.’ is closed to new replies.