Recently, I got the task to remove all MP3- files from some shared folders (SMB shares). To do so, I wrote a tiny batch- script wich processes the DIR command’s output and examines it to match the MP3 extension.
Usage:
The script processes all folders and subfolders in its working directory (e.g. if you run it in c:\scripts it processes all folders and subfolders from there on – c:\scripts\*)
@ECHO OFF
FOR /F "tokens=*" %%G IN ('DIR /B /S *.mp3') DO DEL /F "%%G"