If you use Perl at all, here's a little script I have for doing this, plus taking out other dir types (handy for /bin, etc.. from VS):
#!/usr/local/bin/perl -w
#-------------------------------------------------------------------------------
# removedirs.pl - Recursively removes directories from a given root folder
# Author: Nick Gotch
# Date: 07-13-2009
#-------------------------------------------------------------------------------
use strict;
use warnings;
use File::Path;
#-------------------------------------------------------------------------------
# User Setting Variables
#-------------------------------------------------------------------------------
my $basepath = 'C:\\Path\\to\\RootDir\\';
#-------------------------------------------------------------------------------
# Processing
#-------------------------------------------------------------------------------
# Prompt for Confirmation
syswrite(STDOUT, "Confirm removal of directories?\nPress 'Y' to confirm.\n");
$confirm = <STDIN>;
if($confirm =~ /^[Yy]$/)
{
# Add lines here to remove other dirs...
RemoveDir($basepath, ".svn");
syswrite(STDOUT, "Done.\nPress <ENTER> to close.\n");
}
<STDIN>;
sub RemoveDir
{
my ($directory, $dirtodelete) = @_;
if(-e $directory.'\\'.$dirtodelete.'\\')
{
rmtree($directory.$dirtodelete.'\\');
syswrite(STDOUT, "Removed: ".$directory.$dirtodelete.'\\'."\n");
}
opendir(DIR, $directory);
my @subdirlist;
while(my $subdir = readdir(DIR))
{
if(($subdir ne '.') && ($subdir ne '..') && (-d $directory.$subdir))
{
push(@subdirlist, $directory.$subdir.'\\');
}
}
closedir(DIR);
foreach my $subdir (@subdirlist) { RemoveDir($subdir, $dirtodelete); }
}