Now I use a batch file to delete all files ending with .snpthat are older than 180 days. The code below works to delete all files ending .snpin the root folder
C: \ Program Files \ Snapshots
But I recently discovered that there are folders organized by date in the Snapshots folder.
"1-10-2014, 12-20-2014, 10-15-2014, etc."
and that the line of code below does not work for a recursive search in each directory and therefore does not delete.
What changes should be made to this code so that it recursively scans folders in the root folder and deletes files that exceed 180 days?
forfiles /M *.snp /P "C:\Program Files\Snapshots" /S /D -180 /C "cmd /c del /F /Q @path"
user5373653