How to Delete files through CMD that is older than 30 days?

Command Line Scripting

Deleting Files older than 30 days:

@echo off
:: Delete files older than 30 days

SET SOURCE_DIR=C:\path\to\source

FORFILES /p %SOURCE_DIR% /s /m . /d -30 /c “cmd /c del @path”

echo Files older than 30 days deleted from %SOURCE_DIR%

Leave a Reply

error: Content is protected !!