Computing.Net > Forums > Programming > Batchfile to delete multiple folder

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batchfile to delete multiple folder

Reply to Message Icon

Name: smartguy2020
Date: May 2, 2008 at 12:35:52 Pacific
OS: WINXP
CPU/Ram: 2 g
Comment:

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?



Sponsored Link
Ads by Google

Response Number 1
Name: smartguy2020
Date: May 2, 2008 at 12:38:38 Pacific
Reply:

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.


0

Response Number 2
Name: Mechanix2Go
Date: May 2, 2008 at 20:14:57 Pacific
Reply:

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


0

Response Number 3
Name: chrisyunke
Date: May 11, 2008 at 19:34:20 Pacific
Reply:

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"


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batchfile to delete multiple folder

batch to delete folders www.computing.net/answers/programming/batch-to-delete-folders-/16161.html

deleting multiple lines in multiple text file www.computing.net/answers/programming/deleting-multiple-lines-in-multiple-text-file/19862.html

Batch File Help, 'delete all folder www.computing.net/answers/programming/batch-file-help-delete-all-folder/13383.html