forfiles -p D:\screenshots /s -d -10 /c “cmd /c if @isdir==TRUE rd /s /q @path”
@echo off
setlocal
set “target=D:\screenshots”
set “days=-10”
set “found=0”
REM: 10 günden eski klasörleri kontrol et ve varsa sil
forfiles -p “%target%” /s /d %days% /c “cmd /c if @isdir==TRUE (echo Siliniyor: @path & rd /s /q @path) && set found=1”
REM: Eğer hiç klasör silinmediyse bilgi ver
if %found%==0 (
echo Silinecek klasör bulunamadı.
)
exit /b 0