Create shell menu for TotalCmd - Compare by content

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
ilw
Junior Member
Junior Member
Posts: 5
Joined: 2019-04-09, 12:28 UTC

Create shell menu for TotalCmd - Compare by content

Post by *ilw »

Please help
https://stackoverflow.com/questions/55589583/create-shell-menu-for-totalcmd


stackoverflow wrote:Total Commander have next command line parameters (TOTALCMD.CHM):

/S=C Start "Compare by content" without TC main window, e.g. totalcmd.exe /S=C c:\file1 d:\file2

Nice, but how create shell menu in regedit for this?


 
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: Create shell menu for TotalCmd - Compare by content

Post by *sqa_wizard »

You don't need to create a shell menu.
Just create a button within TotalCmd by copy the whole following text and paste it directly into your button bar:

Code: Select all

TOTALCMD#BAR#DATA
"%COMMANDER_EXE%" /S=C
%C1 %C2
WCMICONS.DLL,48
Compare by content


-1

#5767 Personal license
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: Create shell menu for TotalCmd - Compare by content

Post by *HolgerK »

You can't even use a shell command for this because the shell calls this for every single file.
There are workarounds with single instance Wrappers which can circumvent this restrictions:
https://stackoverflow.com/questions/32107534/more-about-opening-multiple-files-through-the-context-menu
but that's nothing which would work out of the box.

Regards
Holger
Make our planet great again
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Create shell menu for TotalCmd - Compare by content

Post by *Usher »

sqa_wizard wrote: 2019-04-09, 21:27 UTCJust create a button within TotalCmd
I'm afraid you don't understand the meaning of the question. I thinks it should be written using other wording: How to add shell extension to run TC's "Compare by content" directly from the context menu in Windows Explorer, without keeping TC open? See @HolgerK reply…

And your solution seems to be completely mad. Why should anyone run another instance of TC for compare rather than use the option present in TC menu?
Andrzej P. Wozniak
Polish subforum moderator
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: Create shell menu for TotalCmd - Compare by content

Post by *HolgerK »

- Because someone has a list with files and a shell context menu outside of TC?
- Or he does not use TC but likes the TC Compare feature?
- ...

think bigger;-)

Regards
Holger
Make our planet great again
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Create shell menu for TotalCmd - Compare by content

Post by *Usher »

HolgerK wrote: 2019-04-09, 23:39 UTC- Because someone has a list with files and a shell context menu outside of TC?
Sorry, I don't understand… Is it anything different from the first paragraph of my reply? Do you mean - list and context menu outside of Windows Explorer and all open TC instances? Could you explain your idea in simple English, please?
HolgerK wrote: 2019-04-09, 23:39 UTC- Or he does not use TC but likes the TC Compare feature?
Now you have clearly missed the words "ANOTHER INSTANCE" from the second paragraph of my reply. "Another" means "one more, not the previous (already open) ones". Read more carefully, please.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Create shell menu for TotalCmd - Compare by content

Post by *Dalai »

Usher wrote: 2019-04-09, 23:32 UTCWhy should anyone run another instance of TC for compare rather than use the option present in TC menu?
Because one wants to work on other things in the first TC instance? Maybe because the comparison takes some time, e.g. because the files are somewhat large?

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
ilw
Junior Member
Junior Member
Posts: 5
Joined: 2019-04-09, 12:28 UTC

Re: Create shell menu for TotalCmd - Compare by content

Post by *ilw »

Guys, my question exactly for windows shell menu OUTSIDE total cmd.
Thanks ...
User avatar
SSc
Junior Member
Junior Member
Posts: 67
Joined: 2015-10-27, 10:12 UTC
Location: Karlsruhe

Re: Create shell menu for TotalCmd - Compare by content

Post by *SSc »

You can create context menu entries either for all file types, for specific file types (e.g. ".txt") or for folders.

In case you want the shell menu for all types of files, you could do it this way:

1) Under \HKEY_CLASSES_ROOT\*\shell\ Create a key "Compare with Total Commander" (or something like that)
2) Beyond that newly created key, create another key called "command"
3) As a default value for that key, set your command line. E.g. "C:\Program Files (x86)\Total Commander 9\totalcmd.exe" /S=C %1

So it should look like this:

Image: https://cdn1.imggmi.com/uploads/2019/4/10/d70ccd5703de914d6877be9a57196c6c-full.png

And the result in Windows explorer will then be like this:

Image: https://cdn1.imggmi.com/uploads/2019/4/10/6c39e13976a4973b591ce67dc20d3f64-full.png

But be aware: a shell context menu entry can only relate to 1 file (i.e. the one you selected) while your Total Commander call actually expects 2 Params (since you want to compare 2 files). In other words: with my suggested solution you'll have to select the 2nd file manually within the Total Commander Comparison Screen
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Create shell menu for TotalCmd - Compare by content

Post by *Stefan2 »

>>
>> https://stackoverflow.com/questions/6440715/how-to-pass-multiple-filenames-to-a-context-menu-shell-command
>>
>> via SendTo

This works for me:
- create shortcut of TC.exe
- copy that shortcut
- launch WinExplorer and go to 'sendto'
- paste in the shortcut and modify:
General: Name: TOTALCMD Compare two
Shortcut: Target: "path \ to \ TOTALCMD.EXE" /S=C %1 %2

Try:
- select at least two files
> context menu > sendto > 'TOTALCMD Compare two'


Please note how WinEx orders the selected files.
You may want to adjust your own selection order to have the two files in TCs compare tool in the right order.



HTH?
ilw
Junior Member
Junior Member
Posts: 5
Joined: 2019-04-09, 12:28 UTC

Re: Create shell menu for TotalCmd - Compare by content

Post by *ilw »

2Stefan2
I'm already done with "sendto"...
This is a good option, but I will still try through the menu.
User avatar
SSc
Junior Member
Junior Member
Posts: 67
Joined: 2015-10-27, 10:12 UTC
Location: Karlsruhe

Re: Create shell menu for TotalCmd - Compare by content

Post by *SSc »

Thanks. Yes, I know context menu handlers and how to write them. But in your initial question you asked for a pure regedit-based solution, therefore my previous (not perfect) suggestion.

Anyway, it seems that you're now on the right track and can solve it yourself. Great!
ilw
Junior Member
Junior Member
Posts: 5
Joined: 2019-04-09, 12:28 UTC

Re: Create shell menu for TotalCmd - Compare by content

Post by *ilw »

ilw wrote: 2019-04-10, 09:29 UTC I'm try now rework this solution https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/tools/NppShell/src/NppShell.cpp
, but for TotalCMD.
Image: https://i.imgur.com/oVMJn61.gif
Seems to be works ...
Post Reply