Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Batch file to set Windows pagefile initial size to 150% of memory & to set the maximum size to 200% of physical RAM

18 views
Skip to first unread message

Arlen Holder

unread,
Nov 3, 2020, 3:38:05 PM11/3/20
to
Found this batch file to manually set the pagefile.sys size
as I was looking up wmic debug commands to diagnose BSOD errors.

o Command for changeing the page file
<https://social.technet.microsoft.com/Forums/windows/en-US/708da424-3a7c-404d-8f54-f989ed62d323/command-for-changeing-the-page-file>
"This is what I did in my batch file for setting up the page file
with Initial size of 150% physical memory & double for maximum size."

REM -------------------------------------------------------------------------------------------------------
REM setpagefile.bat
REM -------------------------------------------------------------------------------------------------------
REM GET THE PHYSICAL MEM SIZE AS DIGITS
REM --------------------------------------------------------------------------------------------------------
FOR /F "eol=; tokens=1,2,3,4,5 delims=:, " %%i IN ('"systeminfo |find /i "Total Phy""') DO @Set /a m=%%l%%m
REM -------------------------------------------------------------------------------------------------------
REM SET INITIAL MEMORY SIZE 150%of PHYSICAL MEMORY
REM --------------------------------------------------------------------------------------------------------
set /a x=%m%*3/2
REM -------------------------------------------------------------------------------------------------------
REM SET MAXIMUM MEMORY 200% OF PHYSICAL MEMORY
REM --------------------------------------------------------------------------------------------------------
set /a y=%m%*2
REM -------------------------------------------------------------------------------------------------------
REM CHANGE PAGE FILE TO MANUAL
REM --------------------------------------------------------------------------------------------------------
wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False
REM -------------------------------------------------------------------------------------------------------
REM SET PAGEFILE SIZE
REM --------------------------------------------------------------------------------------------------------
wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=%x%,MaximumSize=%y%
--
Sharing batch files enables people who aren't programmers to be more efficient.
0 new messages