:: to delete the file named 'foo.txt' from all subdirectories of the current
:: working directory
:: run this command in the windows cmd.exe shell:
for /f %f in ('dir /d /b') do del /s /q %ffoo.txt
:: if 'foo' is a directory, the previous command merely empties the directory
:: to clean up and remove the empty foo directories afterwards run this command
for /f %f in ('dir /d /b') do rd /s /q %ffoo
del /S *.jpg
del - del command is used delete files from a computer
/S - recurses subdirectories and checks their contents
* - wildcard for the filename
.jpg - the type (extension) wanted
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)