I am trying to create a batch file to delete mulitple folders within a folder. The folders pre-generate when a program is ran. The folders names are the current date in the following format: yyyymmdd. The batch file needs to delete the current folder and the 3 earlier folders. Any suggestions?

I have this code so far: @echo off
del"L:\dbf\yyyy-mm-dd"/Q *
rem I wasn't sure how to identify the folder that generates its name as the date. It changes everyday.
If you cruise through a few dozen threads here, you'll see that 'date math' is always a mess. I might help to post a TREE.
tree L:\dbf
=====================================
If at first you don't succeed, you're about average.M2
or you could just use a simple code that will delete all folders in that folder. something like... ===
@ECHO off:delete
del "folder location here"
