Page 1 of 1

Show created checksums instead of creating checksum files?

Posted: 2022-10-08, 11:12 UTC
by rahuebner
Hi!

Possible that I'm blind, and after all the years of using TC I still overlook the feature but:

Is it possible to show the Checksums instead of writing to files?

TC is a convenient way for me to get close as much to mit Linux CLI usage, most of the times it really works well. But comparing a SHA1 value from a Linux Box with a File stored on my Windows system always ends in running through the attached dialogs, opening the created file, copying the value to clipboard, closing the file and removing it. A lot of extra steps in my eyes, which could be solved with a "display values instead of creating files" option in the last dialog.

I searched for a simple solution, but staying as close as possible to TC, and 7-ZIP is providing an option. But even this is a lot of keyboard/mouse action, just for creating a short `sha1sum test.file` :shock:.

Menu: Image: https://abload.de/img/menu95dkr.jpg
Dialog: Image: https://abload.de/img/dialogghffz.jpg
7-ZIP: Image: https://abload.de/img/7zipxlf3u.jpg

Re: Show created checksums instead of creating checksum files?

Posted: 2022-10-08, 11:56 UTC
by white
Copy the checksum value in the Linux box. In TC, select the original file and start Verify in TC, it will use the checksum on the clipboard for verification.

PowerShell: Show created checksums instead of creating checksum files?

Posted: 2022-10-08, 13:00 UTC
by Stefan2
rahuebner wrote: 2022-10-08, 11:12 UTC
Is it possible to show the Checksums instead of writing to files?


You can do many things with TCs' parameter and a scripting language of your choice.


Here is a copy&pate button-code with posh-code for example:

Code: Select all

TOTALCMD#BAR#DATA
PowerShell -NoProfile -NoExit
Get-FileHash '%N' -Algorithm MD5 ; 'done'
powershell
Get-FileHash %P%N -Algorithm MD5 for one selected file


-1
(%N is TC parameter and must be set into quotes ' %N ' if the file could contain spaces)
Example output in a black DOS/PoSh-box:

Code: Select all


Algorithm       Hash                                                                   Path
---------       ----                                                                   ----
MD5             69B0AB5B80A4B8D38849367C2F457DC1                                       D:\text\wget-1.17.1-win32\wget-1-17-1-x86.exe
done


PS D:\text\wget-1.17.1-win32>


- - -


For one-or-many selected files:
type '%F' | ForEach{...} , (%F is TC parameter, set it in single quotes, or triple double quotes)

Code: Select all

PowerShell -NoProfile -noexit
type '%F' | ForEach{Get-FileHash $_ -Algorithm MD5}


Result:

Algorithm       Hash                                                                   Path                                                                    
---------       ----                                                                   ----                                                                    
MD5             69B0AB5B80A4B8D38849367C2F457DC1                                       D:\text\wget-1.17.1-win32\wget-1-17-1-x86.exe                      
MD5             CD3E4DD83C2AFF96206EBDEC13C9FB9A                                       D:\text\wget-1.17.1-win32\wget-1-17-1-x86.exe.debug                
MD5             8EE44646660F2159D9A8C88CD4C6A8EC                                       D:\text\wget-1.17.1-win32\wget-1-17-1-x86.html                     
MD5             321C6C46E38440224BA0197991CB9879                                       D:\text\wget-1.17.1-win32\wget-1-17-1-x86.ini.sample  




The same, but output to _hashes.txt:
(%F is TC parameter and is surrounded by single quotes)

Code: Select all

PowerShell -NoProfile 
type '%F' | ForEach{Get-FileHash $_ -Algorithm MD5} >"_hashes.txt"


- - -


- - - or even copy the hash of the one selected file automatically to the clipboard:
(%N is TC parameter)

Code: Select all

TOTALCMD#BAR#DATA
PowerShell -NoProfile
(Get-FileHash '%N' -Algorithm MD5).hash | clip
powershell
Get-FileHash "%N" -Algorithm MD5 -- copy to clipboard

1
-1




- - -


%P%N will be auto quoted by TC if space is found.
'%N' need to be quoted by yourself if space could happen.

For PoSh in TC, quotes must be tripled """...""", or use single quotes '...'

"Get-FileHash" will need PowerShell v4 or younger.



References:
https://stackoverflow.com/questions/10521061/how-to-get-an-md5-checksum-in-powershell
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-filehash?view=powershell-7.2
-Algorithm
SHA1
SHA256
SHA384
SHA512
MD5




see my sig for more

 

Re: Show created checksums instead of creating checksum files?

Posted: 2022-10-08, 13:18 UTC
by Dalai
rahuebner wrote: 2022-10-08, 11:12 UTC[...] which could be solved with a "display values instead of creating files" option in the last dialog.
Maybe this can help you: Install the LotsOfHashes plugin, create a custom columns view with the hash type(s) of your choice and switch to that view when you need that information. Keep in mind that the hashes for all files in a directory (or at least all files shown in the panel) will be calculated when switching to that view. Also note that copying the column's values still requires an extra step (menu Mark > Copy To Clipboard With All Details).

Unfortunately, totalcmd.net is down again. If you need the plugin immediately, you can download the plugin here. Otherwise just wait until totalcmd.net is up again (e.g. if you don't trust my download location).

[EDIT]
Wasn't there some mirror created for cases where totalcmd.net is down? I can't remember the details like the URL or who provides thatr mirror.
[/EDIT]

[EDIT2]
Found the mirror: https://ru.wincmd.com/
Unfortunately its certificate has expired two months ago...
[/EDIT]

Regards
Dalai

Re: Show created checksums instead of creating checksum files?

Posted: 2022-10-09, 12:32 UTC
by rahuebner
wow, thanks for all the answers, that helps a lot :-). I personally been forced to swap my desktop often, so a very and unmodified windows installation is meanwhile my best friend, combined with a brought over wincmd.ini. That's the reason why a built-in command was my destination but maybe I can extend my horizon by some .reg files or small tools.
Besides that, what @white responded works great (never heard of that way before). I'm used to compare the hashes visually (right windows, left linux boxes), but this single extra step reorders the progress till the Final result a bit, may does not solve all circumstances, but worked like a Charme in some created tests.

Re: Show created checksums instead of creating checksum files?

Posted: 2022-10-09, 13:17 UTC
by white
rahuebner wrote: 2022-10-09, 12:32 UTC what @white responded works great (never heard of that way before)
It is listed in the help:
Help - Verify Checksums (from checksum files) wrote:
You can verify the checksum of the file under the cursor (or single selected file if any) by copying the checksum to the clipboard (e.g. from the Web page where you downloaded the file) and then choosing this function.