(view source code of memory.bat as plain text)
ECHO Written by Rob van der Woude
ECHO NT Resource Kit available.
ECHO GETRAM.BAT is based on an idea posted on alt.msdos.batch.nt by
ECHO Mike Castle. It uses NT's native WINMSD.EXE instead of PSTAT.EXE
ECHO from the Resource Kit. However, it is much slower than this batch
ECHO GETRAM.BAT is available at http://www.robvanderwoude.com too.
:: Use PSTAT.EXE from the NT 4 Resource Kit
:: to find the amount of RAM installed (in KB)
:: 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
SET /A RAM = %RAM% / 1024
:: Display the result