looping through subfolders help please

  • Thread starter Thread starter terry
  • Start date Start date
T

terry

Can someone post syntax to loop through subfolders having identified the
"root" folder. My psuedo code is below. Thanks

for each folder in ROOT
delete all files
next folder
 
from the command prompt:

for /f %i in ('dir "root folder path here" /b /s') do echo "%i"

within a batch file

for /f %%i in ('dir "root folder path here" /b /s') do echo "%%i"

change the 'echo' to 'del' or 'del /q' once you have tested and this is
what you want.
 
Back
Top