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.
 

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