Synchronize Dirs: Option to ignore extension
Moderators: white, Hacker, petermad, Stefan2
Re: Synchronize Dirs: Option to ignore extension
Total Commander uses checksums (hashes) for file comparison, if you pictures don't match there's no point in making such comparison. You need specific software to compare pictures depending on how much different they can be.
Re: Synchronize Dirs: Option to ignore extension
If I understand correctly (*), the "good" files are in the CLEAN file structure, leaving the "bad" files with the same name, but different extension, in the DIRTY file structure.
Now you want to have a synchronization for these files in a way that you can see and delete the "bad" files in the DIRTY folder(structure).
If so: this CMD script should be able to do that:
Change the settings to match your situation. For example: *.ini should be *.jpg
(It doesn't actually delete these files, but show you what would be deleted)
(and the filename is a resident attribute under normal circumstances. Not a non-resident one. )
(*) Your description is not very clear ..
Now you want to have a synchronization for these files in a way that you can see and delete the "bad" files in the DIRTY folder(structure).
If so: this CMD script should be able to do that:
Change the settings to match your situation. For example: *.ini should be *.jpg
(It doesn't actually delete these files, but show you what would be deleted)
Code: Select all
@echo off
setlocal enabledelayedexpansion
::__________________________________________________________________________
::
:: SETTINGS
::__________________________________________________________________________
::
set "CLEAN=C:\temp"
set "DIRTY=T:\temp"
set "CLEANPATTERN=*.ini"
::__________________________________________________________________________
::
:: ACTION!
::__________________________________________________________________________
::
for /f "usebackq delims=" %%x in (`dir /b /a-d /s "%CLEAN%\%CLEANPATTERN%" 2^>nul`) do (
set DIRTYPATTERN=%%~dpnx
set DIRTYPATTERN=!DIRTYPATTERN:%CLEAN%=%DIRTY%!.*"
echo CLEAN: "%%x"
echo DEL "!DIRTYPATTERN!"
echo.===============================================
)
... on local NTFS filesystems. Not over SMB.
(and the filename is a resident attribute under normal circumstances. Not a non-resident one. )
(*) Your description is not very clear ..