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:
- wmic pagefileset where name="C:\pagefile.sys" set InitialSize=1450,MaximumSize=1450 OR
- 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. Nor 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!
I am having the same problem and ran into a forum about it, the rundown is: via GUI, you may increase it without restart (although not always). if you're using the CMD, this MIGHT work:
If this does not work, it is because of security in your workgroup and there is not much you can do about it if you don't address that first.
source: https://social.technet.microsoft.com/Forums/ie/en-US/e6042586-801f-40e7-8aae-c143ffff6d8d/increase-pagefile-using-commandline-without-reboot?forum=winserversetup
I think a better approach would be to investigate on how to restart your computer automatically and continue running whatever you need.