Downloaded ebook files (.rar/.zip) usually contain multiple formats: pdf, epub, mobi.
This batch script could be used to generate another batch script to remove all .mobi files if there is a .epub file with the same name, as well as .epub files if there is .pdf file.
- Open ebook folder, copy
_find_dup.batto there. - Open
cmd - Run
_find_dup.bat > _del_dup.bat - Check before run
_del_dup.bat
Save this as _find_dup.bat
@echo OFF
For /F "tokens=*" %%G in ('dir /b *.azw3') do (
if exist "%%~dpnG.mobi" or exist "%%~dpnG.epub" or exist "%%~dpnG.pdf" (
@echo ON
echo del "%%~dpnxG"
@echo OFF
)
)
For /F "tokens=*" %%G in ('dir /b *.mobi') do (
if exist "%%~dpnG.epub" or exist "%%~dpnG.pdf" (
@echo ON
echo del "%%~dpnxG"
@echo OFF
)
)
For /F "tokens=*" %%G in ('dir /b *.epub') do (
if exist "%%~dpnG.pdf" (
@echo ON
echo del "%%~dpnxG"
@echo OFF
)
)
@echo ON