one command vs two panels

English support forum

Moderators: Hacker, petermad, Stefan2, white

Lexor
Junior Member
Junior Member
Posts: 14
Joined: 2023-05-14, 12:43 UTC

one command vs two panels

Post by *Lexor »

I have registered Control-V custom hotkey and it does "cm_CRCcheck" - it takes selected checksum files from the current panel and verifies CRC chesksums.

It often happens that I have opened two panels with different directories and both contain some selected checksum files to check.

If I want to verify these selected CRC checksums in both panels then I need these steps:
- press Control-V (1st CRC checking window appears)
- click on main TC windows focus it again
- press TAB to select the other panel
- press Control-V again (2nd CRC checking window appears)

Questions:

1) Is there any way for TC to check selected checksum files from both panels in just one window?
2) If (1) is not possible then maybe there is some way to do all these steps I mentioned above with just one hotkey?
3) If (2) is not possible then maybe there is some way to run some TC command for files from both panels?
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: one command vs two panels

Post by *Stefan2 »

Try this as Command in a Button:

cm_CRCcheck,CM_WAIT 2000,cm_FocusTrg,cm_CRCcheck


- select both files
- click on the button




Did that help?
Lexor
Junior Member
Junior Member
Posts: 14
Joined: 2023-05-14, 12:43 UTC

Re: one command vs two panels

Post by *Lexor »

Stefan2 wrote: 2024-07-01, 20:13 UTCcm_CRCcheck,CM_WAIT 2000,cm_FocusTrg,cm_CRCcheck
I use Configuration -> Options -> Misc -> Command and here I can't enter this string of commands.

Only one command is possible to enter.
User avatar
petermad
Power Member
Power Member
Posts: 16009
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: one command vs two panels

Post by *petermad »

2Lexor
Run the commmand cm_CommandBrowser
In the left list go down to usercmd.ini and click on it
Make a new command - call it for example em_doubleCRCcheck
Enter the command suggested by Stefan2 and save the em_doubleCRCcheck
Now you can use the em_doubleCRCcheck command in Configuration -> Options -> Misc
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Lexor
Junior Member
Junior Member
Posts: 14
Joined: 2023-05-14, 12:43 UTC

Re: one command vs two panels

Post by *Lexor »

petermad wrote: 2024-07-01, 23:21 UTCNow you can use the em_doubleCRCcheck command in Configuration -> Options -> Misc
Thank you, your method works. :)

It's interesting that it was needed to create macro with macros. :shock:

So I suppose there is no current way to run such double panel CRC check with the use of only one CRC window just like one CRC window is used when all checksum files are only in one panel?

I also have one additional question. The current CRC window looks like this:

Code: Select all

checksum.md5:
OK:  file.ext

Errors: 0
OK: 1, not found: 0, read error: 0, wrong checksum: 0
Is there any way to display the directory path of the checksum file? Like this:

Code: Select all

C:\directory\checksum.md5:
OK:  file.ext

Errors: 0
OK: 1, not found: 0, read error: 0, wrong checksum: 0
User avatar
petermad
Power Member
Power Member
Posts: 16009
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: one command vs two panels

Post by *petermad »

2Lexor
You can make a search for *.md5 files in a way so it includes both file panels. Then you can Feed the search result to listbox, select the found .md5 files and run cm_CRCcheck - in that case the full path of the md5 files are shown in the CRC window.

You can use this command in your usercmd.ini file to search in both the source and target panel:

Code: Select all

[em_SearchInSourceAndTarget]
cmd=%COMMANDER_EXE% /S=F
param=""%P";"%T""
button=wcmicons.dll,47
menu=Search for files in both source and target panel
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Lexor
Junior Member
Junior Member
Posts: 14
Joined: 2023-05-14, 12:43 UTC

Re: one command vs two panels

Post by *Lexor »

petermad wrote: 2024-07-02, 10:16 UTCYou can make a search for *.md5 files in a way so it includes both file panels.
I've used the code and it works, so I am one step closer to the ultimate solution to my problem. :D

Now, is there a way to "autocomplete", "autofeed" that search form to listbox, "select all", "check CRC", "quit listbox" to let me search for my md5s in both panels and CRC check them with just one hotkey?
User avatar
petermad
Power Member
Power Member
Posts: 16009
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: one command vs two panels

Post by *petermad »

is there a way to "autocomplete", "autofeed" that search form to listbox, "select all", "check CRC", "quit listbox"
Not if the two directories you start in are not always the same. If they are the same it is possible to fully automate it.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Lexor
Junior Member
Junior Member
Posts: 14
Joined: 2023-05-14, 12:43 UTC

Re: one command vs two panels

Post by *Lexor »

petermad wrote: 2024-07-02, 12:58 UTCNot if the two directories you start in are not always the same. If they are the same it is possible to fully automate it.
Well, the directories with md5 files are not always the same. :(

What would be the solution if they are? Maybe I'll find some way to implement this somehow.
User avatar
petermad
Power Member
Power Member
Posts: 16009
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: one command vs two panels

Post by *petermad »

2Lexor
Well, I cannot make it fully automatic anyway - so here is what you can do:

First you have to make a saved search.
  1. Open the Find Files dialog (Alt+F7).
  2. In the "Search for:" field enter: *.md5
    If you want more checksum formats you can add them here too - for example: *.md5 *.sha1 *.sfv
  3. Clear the field "Search in:" - this is important.
  4. If you want to find the checksum files in the Current dir only or for example only 1 level deep, you can set it in the "Search in subdirectories:" dropdown box.
  5. Click on the Tab "Load/Save"
  6. Click on the button "Save"
  7. Enter the Template name: CrcCheck.
  8. Close the Find Files dialog.
Put these command in your usercmd.ini file:

Code: Select all

[em_CrcChk0]
cmd=%COMMANDER_EXE% /S=F:L==CrcCheck
param=""%P";"%T""

[em_CrcChk]
cmd=em_CrcChk0,cm_Wait 500,cm_SelectAll,cm_CRCcheck
button=wcmicons.dll,61
menu=Run CRC-check with md5 files in source and target dir (and their subdirs)
You might have to use a higher number for the cm_Wait command.

You can now use the em_CrcChk in a keyboard shortcut or in a button in the button bar.

You will have to manually close both the "Search result:" panel (press Backspace) and the "Find Files (Separate)" dialog (might be hiding behind TC's main window) after the CRC Check is done.

______________________

If the directories and .md5 files were the same each time you could do this:

Put these commands in your usercmd.ini file:

Code: Select all

[em_savelist0]
cmd=SAVESELECTION "%COMMANDER_INI_PATH%\crccheck.txt"

[em_savelist]
cmd=cm_SelectAll,em_savelist0,cm_ClearAll
menu=Save search in the file crccheck.txt
button=wcmicons.dll,47

[em_loadlist]
cmd=LOADLIST "%COMMANDER_INI_PATH%\crccheck.txt"
menu=Load search from the file crccheck.txt
button=wcmicons.dll,47

[em_CrcCheck]
cmd=em_Loadlist,cm_Wait 500,cm_SelectAll,cm_CRCcheck
menu=Run CRC-check with md5 files from saved list crccheck.txt
button=wcmicons.dll,61
  1. Make the search for the .md5 in both panels and feed the result to listbox.
  2. Run the command em_savelist
Now you can use em_CrcCheck command to load the saved list of .md5 files and start the CRC check - this way there will be no separate Find Files dialog to close afterwards.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
white
Power Member
Power Member
Posts: 5753
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: one command vs two panels

Post by *white »

petermad wrote: 2024-07-03, 08:53 UTC 3. Clear the field "Search in:" - this is important.
You may want to put in ">" instead. That works too, and that way if you use the saved search in another way (not via Total Commander's command line parameters), then the "Search in" field will retain its value instead of being cleared.
Lexor
Junior Member
Junior Member
Posts: 14
Joined: 2023-05-14, 12:43 UTC

Re: one command vs two panels

Post by *Lexor »

Thank you for sharing your method, petermad.
petermad wrote: 2024-07-03, 08:53 UTC6. Click on the button "Save"
Do you know where that template is saved? To some file? To the registry? Can it be somehow modified manually, outside of TC?
User avatar
white
Power Member
Power Member
Posts: 5753
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: one command vs two panels

Post by *white »

Lexor wrote: 2024-07-03, 15:24 UTC
petermad wrote: 2024-07-03, 08:53 UTC6. Click on the button "Save"
Do you know where that template is saved? To some file? To the registry? Can it be somehow modified manually, outside of TC?
Almost all settings are stored in the ini file, see the About screen (menu option Help/About).
Depending on what you are trying to do, you might be better of changing the loadlist, which is just a regular txt file.
User avatar
petermad
Power Member
Power Member
Posts: 16009
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: one command vs two panels

Post by *petermad »

Do you know where that template is saved?
It is saved to your wincmd.ini file in the section [Searches] as:

Code: Select all

CrcCheck_SearchFor=*.md5
CrcCheck_SearchIn=>
CrcCheck_SearchText=
CrcCheck_SearchFlags=0|002002010021|||||||||0000|0||
you can open your current wincmd.ini file for editing via the menu: Configuration -> Save Settings Files Directly.

I recommend, that if you want to change the saved search, that you in the Find Files dialog, click the Load/Save tab and Load the saved search, alter what you need, and save it again with the same name. Especially the CrcCheck_SearchFlags setting is not for manual editing
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Lexor
Junior Member
Junior Member
Posts: 14
Joined: 2023-05-14, 12:43 UTC

Re: one command vs two panels

Post by *Lexor »

petermad wrote: 2024-07-02, 10:16 UTCYou can use this command in your usercmd.ini file to search in both the source and target panel:

Code: Select all

[em_SearchInSourceAndTarget]
cmd=%COMMANDER_EXE% /S=F
param=""%P";"%T""
button=wcmicons.dll,47
menu=Search for files in both source and target panel
Is there any way to "improve" that search by auto-filling "Search for:" field with "md5" string?
Post Reply