C:\Documents and Settings\Administrator>forfiles /P D:\DELETE\ /S /D -5 /M *.bak /C "cmd /C del @path /Q"

Before execution of the script, you may see file temp.bak older than 5 days. The script execution date is 18th June 2009.
After execution, the file temp.bak was deleted. But still the file backup.bak exists. Because the file backup.bak was created on the day of the execution. That 18th June 2009. Therefore, this demo proves that this script works for deleting files older than some days.

No comments:
Post a Comment