Button to toggle and auto-size MD5 column

I have created a button to toggle the MD5 lister column

Set COLUMNSTOGGLE=md5sum

but every time the column is toggled ON, it is not wide enough to show the whole MD5. How can I make it so that it will toggle AND auto-size the MD5 column. Note that I only want the MD5 column to be auto-sized.

I have already tried adding the following command

Set AUTOSIZECOLUMNS

but this auto-size's all column instead of just the MD5 column.

Is there any way to auto-size a particular column (MD5 in this case) ?

I can't see a way to do this so I've filed a feature request for it to be possible to specify a size (or specify auto-sizing) when adding a new column, without having to turn on auto-sizing of all columns.

For now you might want to look at using a command which switches the current lister to a saved Folder Format, Layout or Style. They should all let you define a format which has the MD5 column sized as you want it.

I noticed these old threads on MD5 and figured I'd update them in case people find them by searching.

This command was added to Opus a while ago:

GetSizes NODESELECT MD5

If you run it with no files selected then it will calculate MD5 checksums for all files in the dir, or if you run it with some files selected then it'll only do the selected ones. Either way it ignores file size and will calculate the checksums of large files, unlike when you just add the MD5 column where large files will be skipped to avoid taking a long time and accessing the disk a lot.

You can use the registry to change the max size limit that is used when the column is added. See the bottom of page 179 in the PDF manual:

[quote]NOTE The MD5 Checksum column calculates and displays the MD5 checksum (hash value) of all files in the current folder. Because calculating the checksum may take a significant amount of time, it is disabled by default for files exceeding 5000kb in size. If you wish to increase this limit, set the following registry value to the desired limit in kilobytes (or set to 0 to have no limit at all):

HKEY_CURRENT_USER\Software\GPSoftware\Directory Opus\Config\User
(DWORD) MaxHashSize = [/quote]
The max size is probably worth keeping since you can run the GetSizes command above when you want to calculate MD5 for larger files.

There's also Clipboard COPYNAMES=hash and Clipboard COPYNAMES=hash2 for putting the filenames and their hashes into the clipboard. More on those can be found in the clipboard FAQ.

This newly added feature might be a bit closer to the mark for this thread.

[quote="The authors of the Opus v8.2 changes.pdf document"]• When adding columns to a Lister with the Set COLUMNSADD or COLUMNSTOGGLE commands it is now possible to specify the width of the new column as well as its position. For example,Set COLUMNSADD=md5sum(3,100) – position 3, width 100 Set COLUMNSADD=md5sum(3,*) – position 3, auto-size Set COLUMNSADD=md5sum(*,100) – position END, width 100[/quote]NOTE: Do not include the "- position ..." portion of the commands above, that is merely a description of the command parameters.

[EDIT]
Note: The v8.2 Changes.pdf incorrectly lists this option as COLUMNADD not COLUMNSADD. I edited this post (and the one above) to reflect the correct syntax. Also, that document does not mention that column numbering starts at 0, not at 1. So the button below actually will add the MD5 Checksum column to the 10th column, not the 9th column. I'm reporting this as a bug, so it may (or may not) change in future a version of Opus.
[EDIT]

Here is a button that pretty much does it all:

Set COLUMNSADD=md5sum(9,*) GetSizes NODESELECT MD5 Set autosizecolumns
It adds the MD5 Hash as the 9th column. The column is set to autosize. The MD5 Hash will be displayed for all selected files. The lister columns will be autosized, which will ensure the entire calculated MD5 hash value is displayed.

On very large files (e.g. .iso image files), you will see "file to large" in angle brackets (which for some reason I cannot type on this forum), while the MD5 Hash is being calculated. But in a few seconds the value will appear.