(Solved) Button for searching for binary-duplicate files between/below different parent-file-paths
Moderators: Hacker, petermad, Stefan2, white
(Solved) Button for searching for binary-duplicate files between/below different parent-file-paths
I often have the problem that I need to search for binary-duplicate-files (with arbitrary filenames that is) not only below a given parent-directory but rather between/below totally different parent-directories located in different sub-trees, mostly even on different drives.
Current binary-duplicates-search in TC-FileFind will only directly support that below a common parent-directory.
To remedy this situation and to expand the capability of TC-FileFind towards searching for binary-dupes even among different sub-trees on possibly different drives (like e.g. different USB-sticks) I've made a proposal for improving TC's functionality in this regard some time ago.
viewtopic.php?p=425376#p425376
It made use of TC's current capability to insert 2 (even multiple) top-level-dirs into the "Search-in"-field of the TC-FF-mask separated by a semi-colon. It would have been (IMHO) almost "a breeze" to implement and would have considerably facilitated the input of those top-level-dirs by simply adding an option for searching as well below both the active- and inactive-panel-file-paths - possibly within the current "Select Drives"-dialog - thereby eliminating the necessity to clumsily having to enter those top-level-dirs verbatim.
Although this suggestion got considerable support at the time it currently doesn't look like our cherished Author, Mr. Ghisler, seems inclined to implement this proposal in the short run.
So my current workaround for this problem is employing some self-declared button making use of the internal "cm_CopySrcPathToClip"-command thereby entering those top-level-dirs into the FF-"Search-in"-field in some kind of a piecemeal fashion via the clipboard.
Now here comes the question: would it be possible to create a more "sophisticated" button that would not only copy the current respective source- and target-path to the clipboard but could instead insert both the source- and target-path, already separated by a semi-colon, directly into the FF-"Search-in"-field?
Current binary-duplicates-search in TC-FileFind will only directly support that below a common parent-directory.
To remedy this situation and to expand the capability of TC-FileFind towards searching for binary-dupes even among different sub-trees on possibly different drives (like e.g. different USB-sticks) I've made a proposal for improving TC's functionality in this regard some time ago.
viewtopic.php?p=425376#p425376
It made use of TC's current capability to insert 2 (even multiple) top-level-dirs into the "Search-in"-field of the TC-FF-mask separated by a semi-colon. It would have been (IMHO) almost "a breeze" to implement and would have considerably facilitated the input of those top-level-dirs by simply adding an option for searching as well below both the active- and inactive-panel-file-paths - possibly within the current "Select Drives"-dialog - thereby eliminating the necessity to clumsily having to enter those top-level-dirs verbatim.
Although this suggestion got considerable support at the time it currently doesn't look like our cherished Author, Mr. Ghisler, seems inclined to implement this proposal in the short run.
So my current workaround for this problem is employing some self-declared button making use of the internal "cm_CopySrcPathToClip"-command thereby entering those top-level-dirs into the FF-"Search-in"-field in some kind of a piecemeal fashion via the clipboard.
Now here comes the question: would it be possible to create a more "sophisticated" button that would not only copy the current respective source- and target-path to the clipboard but could instead insert both the source- and target-path, already separated by a semi-colon, directly into the FF-"Search-in"-field?
Last edited by georgeb on 2023-10-13, 11:28 UTC, edited 1 time in total.
Re: Button for searching for binary-duplicate files between/below different parent-file-paths
Hi,
If you have several paths, this could be a option.
Create a textfile, e.g. "Different_parent-file-paths.txt" and fill it with the desired paths.
If you drag this file into the button bar, it is available for editing with a click on the button.
Save a search - name: Different_parent-file-paths
In the field "Search in:" you can enter e.g. the following: @c:\path\Different_parent-file-paths.txt (see Help!...)
Call up the search via shortcut (em_command required) or button (em_command OR command+parameters).
em_Different_parent-file-paths
Command: %COMMANDER_EXE%
Parameters: /S=F:LDifferent_parent-file-paths
cm_CopySrcPathToClip 2029 Copy source path to clipboard
cm_CopyTrgPathToClip 2030 Copy target path to clipboard
cm_CopyNetNamesToClip 2021 Copy names with UNC path (... with backslash at the end for folders; files)
If you have several paths, this could be a option.
Create a textfile, e.g. "Different_parent-file-paths.txt" and fill it with the desired paths.
If you drag this file into the button bar, it is available for editing with a click on the button.
Save a search - name: Different_parent-file-paths
In the field "Search in:" you can enter e.g. the following: @c:\path\Different_parent-file-paths.txt (see Help!...)
Call up the search via shortcut (em_command required) or button (em_command OR command+parameters).
em_Different_parent-file-paths
Command: %COMMANDER_EXE%
Parameters: /S=F:LDifferent_parent-file-paths
cm_CopySrcPathToClip 2029 Copy source path to clipboard
cm_CopyTrgPathToClip 2030 Copy target path to clipboard
cm_CopyNetNamesToClip 2021 Copy names with UNC path (... with backslash at the end for folders; files)
Re: Button for searching for binary-duplicate files between/below different parent-file-paths
Sounds interesting. Thanks for the advice. The thing is that I don't have a list of recurring source-/target-paths that I could edit. The goal would rather be to set the active file-panel to, say, the source-path and at the same time the inactive file-panel to the target-path and use/transfer both paths from there.tuska wrote: 2023-10-12, 14:57 UTC Create a textfile, e.g. "Different_parent-file-paths.txt" and fill it with the desired paths.
If you drag this file into the button bar, it is available for editing with a click on the button.
I've been wondering though, can those paths ever be accumulated in clipboard? Or wouldn't the second cm_CopyYYYPathToClip-command rather overwrite the path from the first cm_CopyXXXPathToClip-command thereby thwarting the intention of retrieving 2 different paths (separated by a semi-colon) from the clipboard and transferring both of them to the "Search-in"-field of the TC-FF-mask in a concatenated fashion?tuska wrote: 2023-10-12, 14:57 UTC cm_CopySrcPathToClip 2029 Copy source path to clipboard
cm_CopyTrgPathToClip 2030 Copy target path to clipboard
cm_CopyNetNamesToClip 2021 Copy names with UNC path (... with backslash at the end for folders; files)
Re: Button for searching for binary-duplicate files between/below different parent-file-paths
Like this suggestion: https://ghisler.ch/board/viewtopic.php?t=78185 ?georgeb wrote:The goal would rather be to set the active file-panel to, say, the source-path and at the same time the inactive file-panel to the target-path and use/transfer both paths from there.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Button for searching for binary-duplicate files between/below different parent-file-paths
Very much so! Exactly!petermad wrote: 2023-10-12, 17:40 UTC Like this suggestion: https://ghisler.ch/board/viewtopic.php?t=78185 ?




Re: Button for searching for binary-duplicate files between/below different parent-file-paths
I found the solution for this a long time ago, I just forgot to write on the forum
Create such a user command:
or button:
(tune AHK executable and script paths!)
where Search_paths.ahk is something like this:
version with external INI file, may be changed to something like this
using current main INI.
Be aware of possible overwrite saved search!
Create such a user command:
Code: Select all
[em_search_source_and_target]
cmd=AutoHotkey.exe %COMMANDER_PATH%\Search_paths.ahk
param=%P;%T
menu=Search in source and target path
button=WCMICONS.DLL,47
Code: Select all
TOTALCMD#BAR#DATA
AutoHotkey.exe %COMMANDER_PATH%\Search_paths.ahk
%P;%T
WCMICONS.DLL,47
Search in source and target path
%COMMANDER_PATH%\
-1
where Search_paths.ahk is something like this:
Code: Select all
IniWrite, %1%, %COMMANDER_PATH%\ABC.TCS, searches, Search1_SearchIn
Run, %COMMANDER_EXE% /i=%COMMANDER_PATH%\ABC.TCS /S=F:LSearch1
Code: Select all
IniWrite, %1%, %COMMANDER_INI%, searches, Search1_SearchIn
Run, %COMMANDER_EXE% /i=%COMMANDER_INI% /S=F:LSearch1
Be aware of possible overwrite saved search!
Re: Button for searching for binary-duplicate files between/below different parent-file-paths
Thanks a lot for this - as it appears - ready-made solution. It's a pity you didn't post it right away - but as they say: "Better late than never!" I will look into it thoroughly tomorrow.Gral wrote: 2023-10-12, 19:49 UTC I found the solution for this a long time ago, I just forgot to write on the forum
Re: Button for searching for binary-duplicate files between/below different parent-file-paths
2georgeb
I think there is also an interesting solution here:
Find duplicates in specific folders (no matter the filename) - user: milo1012
Button Start search with both paths preselected and "find duplicates" preset ...
I think there is also an interesting solution here:
Find duplicates in specific folders (no matter the filename) - user: milo1012
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_EXE%
/O /S=F "%P;%T"
wcmicons.dll,47
Start search with both current paths preselected || Find Files (separate)|Source: Find duplicates in specific folders (no matter the filename)|https://ghisler.ch/board/viewtopic.php?t=42613
-1
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_EXE%
/O /S=F:L"_duplicates" "%P;%T"
wcmicons.dll,47
Start search with both paths preselected and "find duplicates" --> preset name: _duplicates || Find Files (separate)|Source: Find duplicates in specific folders (no matter the filename)|https://ghisler.ch/board/viewtopic.php?p=300755#p300755
-1
Last edited by tuska on 2023-10-13, 00:08 UTC, edited 1 time in total.
Re: Button for searching for binary-duplicate files between/below different parent-file-paths
2Gral
Note that the first variant where you lauch TC with an arbitrary INI file doesn't have any saved searches, plugins and so on available. This might be fine for some use-cases, but I could see people wanting to have "the best of both worlds". Just wanted to make sure people are aware of this limitation.
Regards
Dalai
Note that the first variant where you lauch TC with an arbitrary INI file doesn't have any saved searches, plugins and so on available. This might be fine for some use-cases, but I could see people wanting to have "the best of both worlds". Just wanted to make sure people are aware of this limitation.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: Button for searching for binary-duplicate files between/below different parent-file-paths
And the solutions seemingly keep on coming! Boy, you just have to ask the right people in the right forum!tuska wrote: 2023-10-12, 23:25 UTC Button Start search with both paths preselected and "find duplicates" preset.
Thanks a lot for pointing this out!
Re: Button for searching for binary-duplicate files between/below different parent-file-paths
Like, for instance, the OP! Thanks @Dalai for pointing this out. But I guess this proposal could somehow be adapted to make use of the regulat TC-instance with all its "bells and whistels" to perform the desired search.Dalai wrote: 2023-10-12, 23:35 UTC 2Gral
Note that the first variant where you lauch TC with an arbitrary INI file doesn't have any saved searches, plugins and so on available. This might be fine for some use-cases, but I could see people wanting to have "the best of both worlds".
Besides the new proposal from @tuska seems to be as simple as it gets while at the same time looking most promising so far.
Re: Button for searching for binary-duplicate files between/below different parent-file-paths
2Dalai
I know that. I've never really used it.
I tested various possibilities.
I know that. I've never really used it.
I tested various possibilities.
Re: (Solved) Button for searching for binary-duplicate files between/below different parent-file-paths
Ok guys, thanks an awful lot for all your excellent and almost immediate advice in this competency-laden forum.
After some analysis of the proposals provided herein and a little experimenting of my own I can now declare that I've reached a perfect solution for my problem which even exceeds all my expectations.
With @tuska pointing out a solution originally given by @milo1012 already in 2015 I've now been able to create a button that will automatically trigger a binary-duplicates-search within an external File-Find-instance between/below the paths selected in both the active as well the inactive panel with precisely all the desired options "ignore filename"/"same size"/"same contents" already pre-selected.
The "trick" is to call a pre-configured File-Find-operation via command-line-parameters thereby being able to insert the currently selected source- and target-paths on-the-fly! Pretty much alike as in (given by @milo1012):
After some analysis of the proposals provided herein and a little experimenting of my own I can now declare that I've reached a perfect solution for my problem which even exceeds all my expectations.
With @tuska pointing out a solution originally given by @milo1012 already in 2015 I've now been able to create a button that will automatically trigger a binary-duplicates-search within an external File-Find-instance between/below the paths selected in both the active as well the inactive panel with precisely all the desired options "ignore filename"/"same size"/"same contents" already pre-selected.
The "trick" is to call a pre-configured File-Find-operation via command-line-parameters thereby being able to insert the currently selected source- and target-paths on-the-fly! Pretty much alike as in (given by @milo1012):
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_EXE%
/O /S=F:L"name_of_properly_configured_duplicates_search_to_be_loaded" "%P;%T"
wcmicons.dll,47
Start search with both paths preselected and "find duplicates" --> preset name: _duplicates || Find Files (separate)|Source: Find duplicates in specific folders (no matter the filename)|https://ghisler.ch/board/viewtopic.php?p=300755#p300755
-1