Simpler invocation of cm_FileSync for archive contents

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Simpler invocation of cm_FileSync for archive contents

Post by *Lefteous »

Here is s small wish which shouldn't be too difficult to add. I often have the situation that I want to compare the contents of archives (which are in the same folder most of the time). The command to use is synchronize dirs. AFAIK the only way to do it is:

1. Open the folder on both sides.
2. Open archive 1 left
3. Open archive 2 right
4. cm_FileSync

What I wanna do is
1. Select both files (on one side or not)
2. cm_FileSync (or maybe a new command)

What do you think?
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: Simpler invocation of cm_FileSync for archive contents

Post by *HolgerK »

Lefteous wrote:AFAIK the only way to do it is:
One way to do it:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_EXE%
/S=S %P%S
wcmicons.dll,48
Synchronize first two marked folder (separate Instance)
%COMMANDER_PATH%

-1
Regards
Holger
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2HolgerK
One way to do it
Thank you! I didn't think that /S=S also supports archives :roll: I don't think we need an extra command.

Can be moved to English forum.
User avatar
Hacker
Moderator
Moderator
Posts: 13066
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

[mod]Your wish is my command. :D

Hacker (Moderator)[/mod]
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

Re: Simpler invocation of cm_FileSync for archive contents

Post by *Damel »

How to make it works, if first archive is on left and second on right panel?

I tested, unsuccessfully (it broke the original functionality when both selected archives are on one side), these parameters:
/S=S:= %P%S %T%R
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

accepts two paths as parameters, or alternatively a settings name in the form /S=S:SettingsName
S: and S:= are meant for the alternate setting files.
%P%S is the list of all selected files in the source panel
%T%R is the list of all selected files in the target panel
If you want to compare the archive under the cursor with the corresponding archive in the opposite panel, you should try:
/S=S %P%N %T%N
(mention that between "/S=S" and "%P%N %T%N" is only a space character)

If these files have different names but in each panel ís only one file selected:
/S=S %P%S %T%R
If more than one file per panel is selected:
/S=S %P%S1 %T%R1
S1 limits the list to the first selected file in source panel.
R1 does the same for the target panel (also it's not explicit listed in Help).

Regards
Holger

Edit:
/S=S:= %P%S1 %T%R1 should work as well with the last used Settings
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

Post by *Damel »

Thank you HolgerK for your advices!

Is there a way how to cover both possibilities by one button, namely that in one case are compared archives in the same panel and in another case is one archive on the left and the second archive on the right panel?
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

How about this solution_

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_EXE% /S=S
%C1 %C2
wcmicons.dll,48
Synchronize first two marked folder (separate Instance)


-1
It will act the same way as Compare by Content. It will sync the first two folders/arhives it sees. If two folders are marked in the active side then these two folders wil be sync'ed (no matter wat is selected or not in the other panel). If one folder is selected in the active panel it will be sync'ed with the first selected folder in the other panel.

If nothing is selected in either panel, Then TC will try to compare the folder under the cursor with a folder with the same name in the opposite panel - NOTE there is no check of whether there actually existst such a folder in the inactive panel - you'll find out when you start the sync - "Left/Right path invalid" message.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

Post by *Damel »

Thank you petermad!

Your solution works for most situation flawlessly, except if you want compare two disks (e.g. work disk and backup disk). An little unclean workaround is to show parent dir [..] in root of drive and place the cursor on it in active panel. Do you (or anybody else ofcourse) have any idea, how to solve this litle glitch?
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
User avatar
Dalai
Power Member
Power Member
Posts: 9390
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2Damel
Try

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_EXE% /S=S
%P %T
wcmicons.dll,48
Synchronize current folders (separate instance)


-1
HTH

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
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

except if you want compare two disks
Then you just use the normal Synchronize Dirs option in the menu...
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

Post by *Damel »

To Dalai: This does not work as expected in connection with the previous requirements (among others comparing the contents of selected archives). But even so, thank you for your effort!

To petermad: I was afraid you'd say that. However, now I will use your code as a user command assigned to the keyboard shortcut (CS+D), which I had with cm_FileSync. So many thanks again!

Code: Select all

[em_FileSync]
button=wcmicons.dll,48
cmd=%COMMANDER_EXE%
param=/S=S %C1 %C2
menu=Synchronize first two marked folders/archives (separate Instance)
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
Post Reply