forfiles -p "C:\what\ever" -s -m *.* /D -<number of days> /C "cmd /c del @path"
I am using the above set to 90 days. It does not want to delete files previous unless set to 30 days. Not sure what I am missing.
forfiles -p "C:\what\ever" -s -m *.* /D -<number of days> /C "cmd /c del @path"
I am using the above set to 90 days. It does not want to delete files previous unless set to 30 days. Not sure what I am missing.
Here's the Powershell way:
$limit = (Get-Date).AddDays(-30)
Get-ChildItem -Path "C:\Path\Whatever" -Recurse | Where-Object {$_.LastWriteTime -lt $limit} | Remove-Item
forfiles -p "C:\what\ever" /s /m *.* /d -30 -c "CMD /C DEL /Q @file"... let me know if that helps you and if you want me to add an answer. – Vomit IT - Chunky Mess Style Feb 24 '17 at 07:13