@echo off set max_days=7 set configPath=E:\Reports\fileConfig.txt echo Configuration file located in %configPath% echo last modified days : %max_days% echo ------------------------------- echo. for /f "tokens=*" %%i in (%configPath%) do ( call :ProcessLine %%i ) pause goto :EOF REM Process each document :ProcessLine SETLOCAL EnableDelayedExpansion set line= "%*" echo Removing files from directory : %line% :: remove files from %path% forfiles -p %line% -m *.* -d -%max_days% -c "cmd /c echo. & echo Deleting file @file : file size = @fsize & del /q @path " echo =============================== echo. ENDLOCAL goto :EOF :EOF
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)