I'm looking for a batch script to go through a certain directory and preserve the 10 newest files while deleting the rest. This is what i have found to work on a single folder and I am having trouble figuring out how to nest it.
@echo off &setlocal
for /f "skip=10 tokens=*" %%a in ('dir /a:-d /b /o:-d') do del %%a
To Sum Up, I can get this script to run in a single folder but not any of the sub folders in that folder, how can this be done?