Deleting folders recursively

I needed recursively delete folders named .svn within a directory structure.

The following will allow you dto do this from a command prompt:

FOR /F "tokens=*" %G IN ('DIR /B /AD /S .svn') DO RMDIR /S /Q %G

Remember, if you’re doing it from a batch file, you’ll need to double up the percent signs, thus:

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S .svn') DO RMDIR /S /Q %%G

You May Also Like

About the Author: John

Leave a Reply

Your email address will not be published. Required fields are marked *