Make a button to make a checksum (MD5) of folder contents?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Dazzer
Junior Member
Junior Member
Posts: 87
Joined: 2016-12-14, 08:35 UTC
Location: Amsterdam

Make a button to make a checksum (MD5) of folder contents?

Post by *Dazzer »

Hi folks,

Imagine i have a folder and i want to create a button to make an MD5 checksum of all files in the folder.

Obviously i can go to: files > create checksum, but is there a way to do it with one click of a button?

So with one click it will select all files and create the checksum, without the need for another click on "ok".

Thanks in advance!
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3378
Joined: 2003-05-06, 11:46 UTC

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *Sir_SiLvA »

Yes.

Now please read the help file...
Hoecker sie sind raus!
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *Fla$her »

No, TC help won't help here. cm_CRCcreate doesn't support parameters.

2Dazzer
In this and this buttons, replace sha1/SHA with md5. In the first one, you also need to remove --exclude=jpg,png,webp.
Overquoting is evil! 👎
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *hi5 »

You can combine commands to select all files and open the Checksum gui, if you want to keep the last settings used just hit enter to start.
You can create several buttons of course to select all files with the same extension (cm_SelectCurrentExtension) for example.

Select and Copy the code below, paste it on an empty space on your button bar. It should select all files and open the Checksum gui - select MD5 (it will remember it between uses).

Code: Select all

TOTALCMD#BAR#DATA
cm_SelectAllFiles,cm_CRCcreate

wcmicons.dll,61
Selects all files, opens CRC


-1
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *Fla$her »

Dazzer wrote: 2024-10-23, 20:41 UTC without the need for another click on "ok".
Another option with TCFS2 (obviously slower than rhash):

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef tcm(312) tcm(3302) tcm(564,1) delay(20) tcm(3304) send({TAB}) send(@m) send({ENTER})

wcmicon2.dll,61
MD5 calculation of all files in the root of the current folder of active panel
or without keystrokes:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef tcm(312) tcm(3302) tcm(564,1) delay(20) tcm(3304) sendmsg(findwnd(,&MD5,findwnd(TCrcForm),,3),$f5) sendmsg(findwnd(,OK,findwnd(TCrcForm)),$f5)

wcmicon2.dll,61
MD5 calculation of all files in the root of the current folder of active panel
Overquoting is evil! 👎
Dazzer
Junior Member
Junior Member
Posts: 87
Joined: 2016-12-14, 08:35 UTC
Location: Amsterdam

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *Dazzer »

Many thanks guys, i went with hi5's suggestion, it gets the job done and i can live with the extra "enter" required!
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *beb »

Dazzer wrote: 2024-10-23, 20:41 UTC ...a button to make an MD5 checksum of all files in the folder.
...
PowerShell-based approach native for modern Windows (8+ which go with bundled PowerShell):
No third-party tools are needed.

User-command (usercmd.ini):

Code: Select all

[em_md5_PowerShell]
cmd=pwsh -c
param=set Algorithm -value MD5;set Log -value (($pwd|split-path -leaf)+'_hashSums.'+$Algorithm);New-Item $Log -type File -Force|Out-null;set Relate -value (($pwd.toString()+'\').Replace('\\','\'));Get-ChildItem -file -recurse -force -exclude $Log|foreach {'{0} {1}' -f (Get-FileHash $_.FullName -Algorithm $Algorithm).Hash.ToLower(),$_.FullName.Replace($Relate,'')|Out-File $Log -append}
button (single-click execution):

Code: Select all

TOTALCMD#BAR#DATA
em_md5_PowerShell

%COMMANDER_EXE%,31


0
-1
The above command takes all (each and every) files in the current directory, calculates their hash-sums (md5), and saves the results (structured in a format: %hash-sum% %relative_path%\%file.name%) into a file named "%current_directory_Name%_hashSums.%hash_algorithm%" within the current directory.
This is the cross-platform PowerShell (7+) based command.
For Windows PowerShell (5.1) change "cmd=pwsh -c" to "cmd=powershell -c".
Get-FileHash accepts the following cryptographic hash algorithms: MD5, SHA1, SHA256 (default), SHA384, SHA512.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *Fla$her »

Dazzer wrote: 2024-10-24, 07:31 UTC it gets the job done and i can live with the extra "enter" required!
And extra selection of radio button after changing to another type.
Why do all this when fully working options are offered? ¯\_(ツ)_/¯
Overquoting is evil! 👎
Dazzer
Junior Member
Junior Member
Posts: 87
Joined: 2016-12-14, 08:35 UTC
Location: Amsterdam

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *Dazzer »

Sorry, one question:

hi5 told me to use this code:
hi5 wrote: 2024-10-23, 21:53 UTC

Code: Select all

TOTALCMD#BAR#DATA
cm_SelectAllFiles,cm_CRCcreate

wcmicons.dll,61
Selects all files, opens CRC


-1



But as far as i can see, all i need is: cm_SelectAllFiles,cm_CRCcreate

What does wcmicons.dll,61 mean?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6951
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *Horst.Epp »

Dazzer wrote: 2024-10-25, 09:48 UTC What does wcmicons.dll,61 mean?
It's the icon which should be used for the button.
Without an icon you would not see your button in the button bar.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
tuska
Power Member
Power Member
Posts: 4046
Joined: 2007-05-21, 12:17 UTC

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *tuska »

2Dazzer
Here is some further information...
Create a Button in the BUTTONBAR (copy/paste CODE)
  1. Click on "SELECT ALL" (to the right of CODE:), then press CTRL+C (copy to clipboard).
  2. Right-click on any place in the button bar, then click on "Paste".
     ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
  3. Option1: Point to the new button (slightly longer): 'Tooltip' is shown (-> description to the button).
                  A maximum of 259 characters is allowed for the tooltip. | = create line break, || = create | as separator character.
  4. Option2: Button bar - "Tooltip" field: A single space deactivates the display of the tooltip.
                  If the "Tooltip" field is empty, the content of the "Command" field is displayed.
  5. Option3: See FAQs and explanation: Button-code (TOTALCMD#BAR#DATA)  <-- <Ctrl+click on the link...>
By the way, the CODE you entered here is NOT correct and does not work!

The correct CODE can be found here.
Dazzer
Junior Member
Junior Member
Posts: 87
Joined: 2016-12-14, 08:35 UTC
Location: Amsterdam

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *Dazzer »

tuska wrote: 2024-10-25, 12:20 UTC

By the way, the CODE you entered here is NOT correct and does not work!

The correct CODE can be found here.
I don't understand, this is my button and it works fine!:

https://ibb.co/wztcJpv
User avatar
tuska
Power Member
Power Member
Posts: 4046
Joined: 2007-05-21, 12:17 UTC

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *tuska »

Dazzer wrote: 2024-10-25, 13:22 UTC
tuska wrote: 2024-10-25, 12:20 UTC

By the way, the CODE you entered here is NOT correct and does not work!

The correct CODE can be found here.
I don't understand, this is my button and it works fine!:

https://ibb.co/wztcJpv
Yes, but please read again exactly what I have told you (click on the links...).
(For example, you had the formatting “bold” in the code above... and that can't work with copy/paste).

By the way, you should always format a code for a button with the corresponding button,
which is displayed at the top when editing a forum post: </> - (it's the 5th button from the left).
Dazzer
Junior Member
Junior Member
Posts: 87
Joined: 2016-12-14, 08:35 UTC
Location: Amsterdam

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *Dazzer »

Damn, i really don't understand, I'm not too technical, all i know is it works so I'm happy!!
User avatar
white
Power Member
Power Member
Posts: 5747
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Make a button to make a checksum (MD5) of folder contents?

Post by *white »

Dazzer wrote: 2024-10-25, 15:02 UTC Damn, i really don't understand, I'm not too technical, all i know is it works so I'm happy!!
That's the most important thing. The rest is extra.

Tuska tried to explain that you can copy the code for a button on the forum and then paste the button directly into the button bar in TC (and the button will magically appear). He explained it in this post, which contains a spoiler block. The spoiler block is the line with at the right a picture of a white eye on a red square. If you click the line, it will expand and you can read the explanation.
Post Reply