Re: [BATCH WORLD] clean useless files efficiently
- Hi Aristos!
Try the following. Run the program and make sure the output is
correct before deleting ECHO on the second last line. The two
commented lines are an example of how you can change directory and
start deleting folders relative to the new directory.
Please note this program only finds folders that match the string
supplied by the CALL statement at the beginning of the directory name.
CALL :_deltree "lime"
would match all folders in the current directory such as "Lime",
"limestone" or even "limey", but not "Slime" or "Lemon and Lime",
- - - -
@echo off & setlocal enableextensions disabledelayedexpansion
cd /d %SystemRoot%
call :_deltree "$NtUninstall"
call :_deltree "$MSI31Uninstall"
call :_deltree "$NtServicePack"
call :_deltree "$UninstallRDC"
call :_deltree "$hf_mig"
:: cd /d %UserProfile%\Local Settings
:: call :_deltree "Temp"
endlocal & exit /b 0
for /f "delims=" %%f in ('dir /b /ad "%~1*"') do ^
echo rd /s /q "%cd%\%%~f"