Remoing directories recursively

  • Thread starter Thread starter Franck Diastein
  • Start date Start date
F

Franck Diastein

Hi,

I want to remove all _svn directories in a given directory...

How can I do it with a batch file ?

TIA
 
That does nothing :-(

I have tried this:

For /d %%f in (*.*) do if exist "_svn" (
rd /s /q "_svn"
)

But it only looks for _svn directory in root directory... I would like
the loop to enter in each directory and search for _svn directories to
delete...

TIA
 
I want to remove all _svn directories in a given directory...

How can I do it with a batch file ?

FOR /D %%i IN (C:\given\*_svn) DO ECHO RMDIR /S /Q %%i

Remove the ECHO to actually do it. Use single % when executing from the
command line.
 
You also have to ask the question you want answered. Your original question
mentioned all _svn directories in a given directory, not in a set of nested
directories. I was going to answer that there couldn't be too many
directories with that name in any one directory (could only be one or zero
of them), until I saw David's first response using "_svn*". I would have
guessed that the pattern you wanted was more likely to be "*_svn", but it
wasn't until your next post that it became obvious that this could not be
the answer.

/Al


"David Candy" <.> wrote in message
You have to use /r to recurse directories.
 
Back
Top