1.

Solve : Need help creating a specific batch?

Answer»

I just need a simple batch that will GO 2 directories deep and DELETE files that lack specific values in their NAME.

ex.
ball.MP3
cat.mp3
(small)ball.mp3
(small)cat.mp3

from this list I would like to delete the objects that do NOT have (small) in their name.

Thanks a lot

also what book do you recommend for learning how to write .bat files effectivelythis might not help much:

Code: [Select]http://www.freedownloadscenter.com/Utilities/File_Maintenance_and_Repair_Utilities/Flash_Renamer.htmltry this for the batch file:

Code: [Select]echo off
set /p comm= what are you looking to delete?
for /f "tokens=* delims=" %%A in ('dir /b /a:d') do (
cd %CD%\%%A
erase /s %comm%*.mp3
)
pause
as for learning to write batch files... experiment that's what i do and always don't be afraid to ask.

EDIT: if your going to experiment, especially with deleting things... make a backup!

FB



Discussion

No Comment Found