폴더내의 NEF파일은 있지만 JPG파일이 없는 NEF파일들을 삭제해준다.
@echo off
@setlocal EnableDelayedExpansion
title jpg nef del
set L=
set n=0
for %%N IN (*.nef) DO (
set J=%%~nN.JPG
rem echo %%N
rem echo !J!
if exist %%~nN.jpg (
rem
) else (
set L=!L! "%%N"
set /a n=!n!+1
)
)
if %n% == 0 (
echo There is no any NEF file that does not have the JPG file.
goto QUIT
)
echo
echo Warning :: The program will delete following (%n%) NEF files that don't have the JPG file.
echo %L%
:LOOP
set /p YN=(Y/N)?
if /i "%YN%" == "y" goto YES
if /i "%YN%" == "n" goto NO
goto LOOP
:YES
del %L%
echo %n% files deleted.
goto QUIT
:NO
echo deleting aborted.
goto QUIT
:QUIT
pause
댓글