简体   繁体   中英

Increase PageFile using commandline without reboot

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 OR
  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. 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:

wmic process where name="explorer.exe" call terminate
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM