windows - Delete files older than x while ignoring subfolders -


i've found several posts close question, wanted run guys 100% clear. have folder: b:/backups has 2 subfolders b:/backups/cust1 , b:/backups/cust2. b:/backups contains many .bak files.

i'd delete .bak files older x`` days b:/backups while ignoring subfolders , contents.

i prefer batch file/robocopy if possible. can me started? here have tried:

forfiles /p b:/backups\ /s /m *.bak /d -7 /c "cmd /c del @file" 

forfiles -p "b:\backups\" -s -m *.bak /d 7 /c "cmd /c del @file" 

this delete .bak files older 7 days in specified folder, while ignoring subfolders.


Comments

Popular posts from this blog

php - Extract Text from HTTP referer -

Receive udp packets in android gstreamer -

authentication - ASP.NET Core 1.0. Bearer Token, cannot access custom claims -