Synchronize Dirs: Option to ignore extension

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

JardaSX
Junior Member
Junior Member
Posts: 27
Joined: 2020-04-04, 23:27 UTC

Re: Synchronize Dirs: Option to ignore extension

Post by *JardaSX »

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.
NotNull
Senior Member
Senior Member
Posts: 269
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: Synchronize Dirs: Option to ignore extension

Post by *NotNull »

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)

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.===============================================
	)


arko wrote: 2020-04-06, 12:52 UTC Yeah, and filename is just a non-resident attribute in MFT...
... 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 ..
Post Reply