Page 1 of 1

FOR /R exclude ".svn" directory

Posted: 20 Feb 2009 09:56
by torrentrocks
How do I recursively get a list of sub-directories but exclude ".svn" directory in the list?

Code: Select all

FOR /R %d IN (*) DO @echo %d

Posted: 20 Feb 2009 13:40
by RElliott63
Try this:


Code: Select all

 Dir * /aD/b/s |  Find /V ".SVN" > %Temp%\NewList
 For /F "Delims=" %%F In (%Temp%\NewList) Do (
   Echo File Name is : %%~nxF
 )



hth

-Rick

Posted: 20 Feb 2009 22:26
by DosItHelp
Or without temp file:

Code: Select all

For /F "Delims=" %%A In ('"Dir * /aD/b/s|Find /V ".SVN" "') Do (
   Echo Directory Name is : %%A
)

:wink: