Link to home
Start Free TrialLog in
Avatar of cliffordgormley
cliffordgormleyFlag for United States of America

asked on

need to delete files in specific folders that exceed 3 days in age

Hello,
Windows 7
I need to delete files in specific folders that exceed 3 days in age.
What is a good automated way to do this?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of McKnife
McKnife
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
forfiles -p "C:\yourfolder\" -s -m *.* -d 3 -c "cmd /c del @path"

you can get this running with task schedular so that it runs automatically.
@anuroopsundd
Could it be that you repeated my comment unintentionally?
Avatar of cliffordgormley

ASKER

Hello
I am getting the following error message.

D:\cliff\Documents\CliffFilezillaVideo>forfiles -p "D:\cliff\Documents\CliffFilezillaVideo\" -s -m *.* -d 3 -c "cmd /c del @path
ERROR: Invalid argument/option - '@path'.

Thanks!
It's always useful to read the manual thoroughly :)
Try
FORFILES /P D:\cliff\Documents\CliffFilezillaVideo /S /d +03 /C "cmd /c del @path"