Deleting some directories recursively (i.e. .svn folders when you start a new project)
How to delete all the .svn folders using a simple batch file
You are doing a new project and you want to use the old files there. Moreover you have everything under Subversion. In that case, if the old files have a lot of folders it can be a nightmare to delete all the .svn files one by one.
Using this mini-script will do the trick with only two clicks (or a return ^^) without installing any software... so if you are under some strict policies, then it can help you.
Let's hope that some of you will find it useful! I've found it on the Internet and thought it would be really interesting to share it here... more after reading some problems with Subversion.
Here it goes, the line you've to execute:
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%%G"You can see the full post at this link[^], where the author (vanillabean) has posted these explanations:
Hope this helps. :thumbsup:FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q %%GIf you're thinking WTF?:DIR /B /AD /S *.svn*
lists all files that are named .svn/B
makes the output "bare" with nothing but the file name/AD
only lists directories/S
recurses subdirectories to include their contents if they match the listing criteriaRMDIR /S /Q [path/name]deletes the directory [path/dir] and all of it's childrenFOR /F
processes each item (in this case directories) in the setIN ('[command]')
by executing theDO [command]
%%G
is a parameter, which in this example is a directory name"tokens=*"
says that all the characters output in a line (i.e. by thedir
command) are assigned to the parameter%%G