Solved to delete old folders of format yyyy-dd-mm

November 1, 2012 at 04:15:53
Specs: Windows 7
i need to delete old folders of format yyyy-dd-mm ..say .2012-23-10,2012-27-10.2012-30-10,2012-02-11,2012-05-11,2012-07-11...........it should delete 2012-23-10,2012-27-10.2012-30-10 folders...but keep other folders...need a batch script regarding the same.
And more precisely i need to keep the 3 folders which are latest modified and delete older ones

See More: to delete old folders of format yyyy-dd-mm

Report •


#1
November 1, 2012 at 09:57:53
✔ Best Answer
This has been asked many times, but searching the forum for specific incidents would take me longer than typing this. (Untested)
for /f "skip=3 delims=" %%a in ('dir /ad/b/o-d ????-??-??') do rd /s /q %%a

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question