:: Batch for auto setting fbwf and ramdriv size (using Sherpya´s autoramresizer.exe)
:: fbwf will be set to 20% and B: to 5% of total system ram
:: Use PSTAT.EXE from the NT 4 Resource Kit
:: to find the amount of RAM installed (in KB)
FOR /F "tokens=2 delims=K " %%A IN ('PSTAT ^| FIND "Memory:"') DO SET RAM=%%A
:: The following command line is added to round up instead of down;
:: change the value from 1023 to 512 for "mathematical" rounding,
:: or remove the line to round down
SET /A RAM = %RAM% + 1023
:: Convert from KiloBytes to MegaBytes and set to 20%
SET /A RAM = %RAM% / 1024 / 5
:: setting fbwf 20% of system memory
reg.exe ADD HKEY_LOCAL_MACHINE\System\ControlSet001\Services\FBWF /f /v WinPECacheThreshold /t REG_DWORD /d %RAM%
:: setting B: 5% of system memory
SET /A RAM = %RAM% / 4
autoramresizer.exe -l %RAM% -h %RAM%