How do I change so that I do the same for folders instead of files?
So, what I want is: delete folder AND its contents if the folder is older than 30 days
The code for deleting the files is:
Code: Select all
REM Remove files older than 30 days
forfiles /p "C:\Users\YOURUSERNAME\Downloads" /s /m *.* /c "cmd /c Del @path" /d -30
After having this setup, I can use Task Scheduler to run this batch file every 30 days
Awesome - just what I wanted
Or is there a better way to do?
Thanks
OM