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

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -