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
 
Back
Top