Add automated_rammap.bat

This commit is contained in:
2026-06-24 22:24:17 +00:00
parent 601f11b2b6
commit 0f9a67d903

56
automated_rammap.bat Normal file
View File

@@ -0,0 +1,56 @@
@echo off
color 0A
echo installing rammap automated cleanup...
:: set variables
set INSTALLDIR=C:\ProgramData\RAMMap
set RAMMAP=%INSTALLDIR%\RAMMap64.exe
set SCRIPT=%INSTALLDIR%\automated_rammap.bat
:: create rammap directory
mkdir "%INSTALLDIR%"
:: download rammap
echo downloading rammap...
curl -L -o "%TEMP%\RAMMap.zip" https://download.sysinternals.com/files/RAMMap.zip
:: extract rammap
echo extracting...
tar -xvf "%TEMP%\RAMMap.zip" -C "%INSTALLDIR%"
:: create automated cleanup script batch file
echo creating automated cleanup script...
(
echo @echo off
echo set RAMMAP=%RAMMAP%
echo %RAMMAP% -accepteula -Ew
echo %RAMMAP% -accepteula -Es
echo %RAMMAP% -accepteula -Em
echo %RAMMAP% -accepteula -Et
echo %RAMMAP% -accepteula -E0
echo exit /b 0
) > "%SCRIPT%"
:: create the scheduled task
echo creating scheduled task...
schtasks /create ^
/tn "RAMMap Automated Cleanup" ^
/tr "%SCRIPT%" ^
/sc minute ^
/mo 30 ^
/ru SYSTEM
:: cleanup rammap zip file
del "%TEMP%\RAMMap.zip"
echo .
echo rammap cleanup deployed successfully
echo this has created a scheduled task which runs rammap every 30 minutes as system
echo now you wont have to manually do it \(^^_^^)/
pause
exit 0