@echo off
setlocal
set fcount=0
set nzbcount=0
set sfvcount=0
set urlcount=0
set dbcount=0
echo.
echo [Cleanup] Cleaning up download directory: %1
echo [Cleanup] Deleteing .nzb files
for /f %%V in ('dir %1*.nzb /b /s ^| find /v /c ""') do set/a nzbcount = %%V
del /s /q "%1"*.nzb > NUL 2>NUL
echo [Cleanup] Deleteing .sfv files
for /f %%V in ('dir %1*.sfv /b /s ^| find /v /c ""') do set/a sfvcount = %%V
del /s /q "%1"*.sfv > NUL 2>NUL
echo [Cleanup] Deleteing .url files
for /f %%V in ('dir %1*.url /b /s ^| find /v /c ""') do set/a urlcount = %%V
del /s /q "%1"*.url > NUL 2>NUL
echo [Cleanup] Deleteing .db files
for /f %%V in ('dir %1*.db /b /s ^| find /v /c ""') do set/a dbcount = %%V
del /s /q "%1"*.db > NUL 2>NUL
set/a fcount = %nzbcount% + %sfvcount% + %urlcount% + %dbcount%
echo [Cleanup] Deleted %fcount% files (%nzbcount% nzb, %sfvcount% sfv, %urlcount% url, %dbcount% db)
echo.
Batch files are text files containing a script of commands that are executed by the command interpreter on DOS, OS/2 and Windows systems. Most commonly, they are used to perform a series of functions that are repeated -- copying a set of files created daily with one step, for example.
TRUSTED BY
ASKER