Reputation: 555
I am trying to manage some of my backup overflow problems. Currently I have a .bat file that will delete all the files that are > 14 days old. My problem is that I need to loop through all subfolders and delete all .bak files that are > 14 days old as well. Any help would be appreciated.
here what i have so far.
D:
cd D:\DBBK
forfiles -p D:\DBBK -m *.bak -d -14 -c "cmd /c del @file"
Upvotes: 1
Views: 1061
Reputation: 555
ok, so that was easy. i only had to add an "/s" to the forfiles.
D:
cd D:\DBBK
forfiles /s -p D:\DBBK -m *.bak -d -14 -c "cmd /c del @file"
Upvotes: 3