How to compare two directories?
Moderators: Hacker, petermad, Stefan2, white
How to compare two directories?
I'm talking not about synchronization. I'm looking for a tool that works: we have two panels. At first panel we have 100 files and folders. At second one we have 70 files and folders and many of them are from the first panel. I make the first one an active. After use the tool and it selects files and folders from the first panel that are not in the second one. After that i can easy press F5 and copy that files and folders.
Re: How to compare two directories?
For instance: at left we have files: 1, 2, 3, 4, 5. At right we have: 1, 4, 5. When i press the tool button i get selected files 2 and 3.
Re: How to compare two directories?
Maybe
Menu "Commands > Synchronize Dirs..."
Or
Menu "Mark > Compare Directories" (cm_CompareDirs=533;Compare dirs)
(cm_CompareDirsWithSubdirs=536;Also mark subdirs not present in other dir)
Or use
Save Selection (cm_CopyNamesToClip=2017;Copy filenames to clipboard)
go to other panel and
Load Selection (cm_LoadSelectionFromClip=2033;Read file selection from clipboard)
See text file "TOTALCMD.inc"
And see Extended English Menus for Total Commander by petermad
https://www.ghisler.ch/board/viewtopic.php?t=33740
Screenshot: http://madsenworld.dk/wincmd/tc9win10en.gif
Menu "Commands > Synchronize Dirs..."
Or
Menu "Mark > Compare Directories" (cm_CompareDirs=533;Compare dirs)
(cm_CompareDirsWithSubdirs=536;Also mark subdirs not present in other dir)
Or use
Save Selection (cm_CopyNamesToClip=2017;Copy filenames to clipboard)
go to other panel and
Load Selection (cm_LoadSelectionFromClip=2033;Read file selection from clipboard)
See text file "TOTALCMD.inc"
And see Extended English Menus for Total Commander by petermad
https://www.ghisler.ch/board/viewtopic.php?t=33740
Screenshot: http://madsenworld.dk/wincmd/tc9win10en.gif
Re: How to compare two directories?
2鸞鸞鸞
Make this button in TC's button bar:After use the tool and it selects files and folders from the first panel that are not in the second one.
Code: Select all
TOTALCMD#BAR#DATA
cm_SelectAllBoth,cm_CopyNamesToClip,cm_FocusTrg,cm_GoToFirstEntry,cm_ClearAll,cm_LoadSelectionFromClip,cm_CopyNamesToClip,cm_ExchangeSelBoth,cm_FocusTrg,cm_ClearAll,cm_LoadSelectionFromClip,cm_ExchangeSelBoth
wcmicons.dll,72
Mark files and folders that does not exist in both windows
-1
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
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: How to compare two directories?
No, synchronization is a different tool. Compare directories does the different action and i can't understand what exactly it does.
Re: How to compare two directories?
Thanks, will try.
Re: How to compare two directories?
Re: How to compare two directories?
Use
internal command. From command line or add to menu.
Code: Select all
cm_CompareDirsWithSubdirs
Re: How to compare two directories?
Thank you.Gral wrote: 2021-08-01, 15:15 UTC Useinternal command. From command line or add to menu.Code: Select all
cm_CompareDirsWithSubdirs
Re: How to compare two directories?
2鸞鸞鸞
There is no way you can get a "file not found!" mesage if you have done as instructed - Please try again - follow the procedure excactly:It doesn't work.
Also - I don't see my suggested button in your buttonbar in your screenshot.To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
Last edited by petermad on 2021-08-01, 20:14 UTC, edited 4 times in total.
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: How to compare two directories?
This wil mark files that exists in both panels if they have different size or date - that is not what 鸞鸞鸞 asks forGral wrote: 2021-08-01, 15:15 UTC Useinternal command. From command line or add to menu.Code: Select all
cm_CompareDirsWithSubdirs
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: How to compare two directories?
petermad wrote: 2021-08-01, 20:00 UTC
There is no way you can get a "file not found!" mesage if you have done as instructed - Please try again - follow the procedure excactly:
It doesn't work. I did all correct. I tried on TC 9.51. Will update and try on the newest.
You can't see your icon coz I use a different icon library. I have no icon library as in your code.
Also - I don't see my suggested button in your buttonbar in your screenshot.
Last edited by 鸞鸞鸞 on 2021-08-02, 10:08 UTC, edited 2 times in total.
Re: How to compare two directories?
鸞鸞鸞 wrote: 2021-07-31, 14:37 UTC At first panel we have 100 files and folders.
At second one we have 70 files and folders and many of them are from the first panel.
I make the first one an active.
After use the tool and it selects files and folders from the first panel that are not in the second one.
After that i can easy press F5 and copy that files and folders.
I have LEFT
1\
2\
3\
4\
5\
File2.txt
File4.txt
I have RIGHT
1\
4\
5\
File1.txt
File2.txt
File3.txt
After executing petermad's command, these are selected:
- Left 2\ 3\ + File4.txt
- Right File1.txt + File3.txt
The same as with internal command cm_CompareDirsWithSubdirs
But cm_CompareDirsWithSubdirs will also "..mark files that exists in both panels if they have different size or date.."
...depended, which file is newer in one or another panel. (Try to modify File2.txt in LEFT or RIGHT panel to see the differences)
Petermad's command will just select non-existent files/folders, no matter if modified or not.
Re: How to compare two directories?
2鸞鸞鸞
New code (with correct icon library):
Could you try this for me: Right-click on the button you have with my code and choose "Copy" - and then paste it (with Ctrl+V) in a post here in this thread.
I just tried it in TC 9.51 - it works there too for me.It doesn't work. I did all correct. I tried on TC 9.51. Will update and try on the newest.
You are right, it should have been wcmicons.dll and not wciconex.dll (wcmicons.dll should be installed by default).You can't see your icon coz I use a different icon library. I have no icon library as in your code
New code (with correct icon library):
Code: Select all
TOTALCMD#BAR#DATA
cm_SelectAllBoth,cm_CopyNamesToClip,cm_FocusTrg,cm_GoToFirstEntry,cm_ClearAll,cm_LoadSelectionFromClip,cm_CopyNamesToClip,cm_ExchangeSelBoth,cm_FocusTrg,cm_ClearAll,cm_LoadSelectionFromClip,cm_ExchangeSelBoth
wcmicons.dll,72
Mark files and folders that does not exist in both windows
-1
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: How to compare two directories?
I was mistaken. My portable version was 8.52. I have updated to 10 and now your script works. Thank you.petermad wrote: 2021-08-02, 19:31 UTC 2鸞鸞鸞I just tried it in TC 9.51 - it works there too for me.It doesn't work. I did all correct. I tried on TC 9.51. Will update and try on the newest.