FOR /R exclude ".svn" directory

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
torrentrocks
Posts: 1
Joined: 20 Feb 2009 08:47

FOR /R exclude ".svn" directory

#1 Post by torrentrocks » 20 Feb 2009 09:56

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

RElliott63
Expert
Posts: 80
Joined: 04 Feb 2009 10:03

#2 Post by RElliott63 » 20 Feb 2009 13:40

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

DosItHelp
Expert
Posts: 239
Joined: 18 Feb 2006 19:54

#3 Post by DosItHelp » 20 Feb 2009 22:26

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:

Post Reply