I had a really deep hierarchy of directories and files and I wanted to remove all the .FooBar directories and their contents. In a batch file, this solves it:
@echo off
for /f "tokens=* delims=" %%a in ('dir /ad /b /s *.FooBar') do
(
rd /s /q "%%a"
)