Batch File to delete subdirectories that are named in a text file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I would like to create a batch file to - Read a directory name from a text file and delete all the contents of that directory - leaving the directory intact but empty

thanks for any advice

DaveF
 
DaveF said:
Hi I would like to create a batch file to - Read a directory name from a
text file and delete all the contents of that directory - leaving the
directory intact but empty

thanks for any advice

DaveF

Assuming that there are no hidden/system/readonly files in the tree, Deltree
followed by mkdir ought to do the trick.

JosephKK
 
Hi Joseph - Thanks for your advice - yes why not delete
the whole tree (only if named in text file) and just
remake the directories again (as we already have the dir
name)
Thanks again
DaveF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top