How to delete all .svn folders on Windows XP & Vista

Have you ever needed to delete all .svn metadata from a certain folder on a Windows XP or Vista system?

On a Unix system, you could easily write a quick command to solve this dilemma, but in Windows it can be a bit more complicated because a search only returns up to 5000 items at a time. This means searching and deleting the folders can be a hassle when you're dealing with a very deep hierarchy of folders. However, you can easily resolve this problem by creating a file called "delete-svn.reg" with the following content:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
@="Delete SVN Folders"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
@="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn _svn) DO RD /s /q \"%%f\" \""

Double-click this file, and you should now see an item called "Delete SVN Folders" when you right-click on a folder.

Lt6Si99x