Batchfile to delete multiple folder

May 2, 2008 at 12:35:52
Specs: WINXP, 2 g

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?

See More: Batchfile to delete multiple folder

Report •


#1
May 2, 2008 at 12:38:38

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.


Report •

#2
May 2, 2008 at 20:14:57

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


Report •

#3
May 11, 2008 at 19:34:20

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"


Report •

Related Solutions


Ask Question