M
m.
User
- Workaround / Automatismus für Löschen der...
- #1
This is not a question but a SOLUTION.
PLEASE TRY IT FIRST WITH A COPY OF A SMALL GROUPE OF FOLDERS THAT YOU WANT TO PROCESS BEFORE APPLYING IT TO YOUR WHOLE PICTURE COLLECTION.
Since there are already many topics about "IMG_E" files, but none of them can be answered anymore because they were closed by the community or system, I have to write a new one here.
It's about the duplicate pictures and videos that start with "IMG_E" instead of "IMG_". For example, IMG_E0023.HEIC, IMG_E0023.JPG, IMG_E0023.MOV and there are also the "original" versions IMG_0023.HEIC, IMG_0023.JPG, IMG_0023.MOV.
I wrote a batch script for the Windows command line that searches for the "E" files and checks if there is an original version. If there is, the "E" file will be deleted.
PLEASE TRY IT FIRST WITH A COPY OF A SMALL GROUPE OF FOLDERS THAT YOU WANT TO PROCESS BEFORE APPLYING IT TO YOUR WHOLE PICTURE COLLECTION.
Since there are already many topics about "IMG_E" files, but none of them can be answered anymore because they were closed by the community or system, I have to write a new one here.
It's about the duplicate pictures and videos that start with "IMG_E" instead of "IMG_". For example, IMG_E0023.HEIC, IMG_E0023.JPG, IMG_E0023.MOV and there are also the "original" versions IMG_0023.HEIC, IMG_0023.JPG, IMG_0023.MOV.
I wrote a batch script for the Windows command line that searches for the "E" files and checks if there is an original version. If there is, the "E" file will be deleted.
Code:
batch
Copy code
@echo off
setlocal enabledelayedexpansion
rem Start the search in the current directory (or specify a path)
for /r %%d in (.) do (
rem Search for all IMG_E*.MOV files
for %%e in ("%%d\IMG_E*.MOV") do (
rem Create the name of the corresponding original file IMG_*.MOV
set "original=%%~dpne.MOV"
set "edited=%%e"
rem Check if the original file exists
if exist "!original!" (
rem If the original file exists, delete the edited MOV file
echo Deleting !edited!
del /q "!edited!"
)
)
rem Search for all IMG_E*.HEIC files
for %%e in ("%%d\IMG_E*.HEIC") do (
rem Create the name of the corresponding original file IMG_*.HEIC
set "original=%%~dpne.HEIC"
set "edited=%%e"
rem Check if the original file exists
if exist "!original!" (
rem If the original file exists, delete the edited HEIC file
echo Deleting !edited!
del /q "!edited!"
)
)
rem Search for all IMG_E*.JPG files
for %%e in ("%%d\IMG_E*.JPG") do (
rem Create the name of the corresponding original file IMG_*.JPG
set "original=%%~dpne.JPG"
set "edited=%%e"
rem Check if the original file exists
if exist "!original!" (
rem If the original file exists, delete the edited JPG file
echo Deleting !edited!
del /q "!edited!"
)
)
)
endlocal