How to change virtual memory on systems with different RAM sizes via script ?
I have Win10 ENT 1809 systems with 8GB of RAM and now 16GB of RAM. How can I change the virtual memory via a script that reads the RAM amount and changes accordingly ? The WIM virtual memory is set for 8GB 12288/24576 and 16GB machines needs to be set at 24576/49152. I just need a script I can run in a task sequence after image deployment. HELP.
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
SMal.tmcc
5 years ago
open google and search "change page file command line"
https://www.google.com/search?client=firefox-b-1-d&q=change+page+file+command+line
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=2048After setting the pagefile yourself, you can check its settings with:
wmic pagefileset or wmic pagefileset list /format:listthen restart your computerregards,
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.
Comments:
-
Thank you SMal.tmcc . However, I need a line or 2 that will read the RAM size and adjust virtual memory accordingly. - CruzJr 5 years ago