Batch script to delete X days old file from specified location. Where is X is number of days.
REM Remove files backup older than X days
Echo Deleting Bak file….
forfiles /p “Folder Path” /s /m *.bak /c “cmd /c Del @path” /d -X
Folder Path= Replace with target folder.
Replace X with no of days (Eg :3 for 3 days old)