go to file with different extension
Moderators: petermad, Stefan2, white, Hacker
go to file with different extension
Is there possibility to go to file with different extension in file list? In some cases navigating through different file types would be much quicker like moving down by arrow key or page key. Especially when sorted by extension it is required enough to skip to next file type (extension).
Re: go to file with different extension
Using Autorun beta:
autorun.cfg
Code: Select all
LoadLibrary Plugins\Autorun_Runtime.dll #—————————————————————————————————————— # Go to the next/previous item with a different extension [1 — include folders] RegisterCommand 76553 GoToNextExt RegisterCommand 76554 GoToNextExt 1 RegisterCommand 76555 GoToPrevExt RegisterCommand 76556 GoToPrevExt 1 Func GoToNextExt(lParam, Dirs=0) Local LoopStart = RequestInfo(11007) + 1, LoopEnd = RequestInfo(11001) - 1 If LoopStart > LoopEnd Then Return If Not Dirs And LoopStart < RequestInfo(11011) Then SendCommand(2050) Return EndIf Local sPanel = RequestInfo(3), Ext = FileGetExt(GetCurrentItem()) For i = LoopStart To LoopEnd If Ext <> FileGetExt(StrPart(SendMessage(sPanel, 0x0189, i, 0, 2), auTAB, 1)) Then SendMessage(sPanel, 0x19E, i, 1) CommandExec('cm_Reverse', -1) CommandExec('cm_Reverse', -1) Break EndIf Next EndFunc Func GoToPrevExt(lParam, Dirs=0) Local LoopStart = RequestInfo(11007) - 1, LoopEnd = RequestInfo(11009) ? 1 : 0 If LoopStart < LoopEnd Then Return Local File1Index = RequestInfo(11011) If Not Dirs And LoopStart < File1Index Then Return Local sPanel = RequestInfo(3), Ext = FileGetExt(GetCurrentItem()) For i = LoopStart To LoopEnd Step -1 If Not Dirs And i < File1Index Then Break If Ext <> FileGetExt(StrPart(SendMessage(sPanel, 0x0189, i, 0, 2), auTAB, 1)) Then SendMessage(sPanel, 0x19E, i, 1) CommandExec('cm_Reverse', -1) CommandExec('cm_Reverse', -1) Break EndIf Next EndFunc- Totalcmd.inc:
Code: Select all
[________Custom Commands_________]=0 cm_GoToNextExt=76553; cm_GoToNextExtD=76554; cm_GoToPrevExt=76555; cm_GoToPrevExtD=76556; - Restart TC.
- Use cm_GoToNextExt/cm_GoToPrevExt (files) or cm_GoToNextExtD/cm_GoToPrevExtD (folders + files).
Overquoting is evil! 👎
Re: go to file with different extension
Sorry, I misinterpreted the request, my solution is for "go to file with same name but different extension"
a Test.cmd
a Test.txt
a Test.zip
" SHOW ONLY files with same name: CD "%O.*" "
Depending on what you do, maybe this helps too?
- select the file
- press the below button, to see all files with same name
- select the file you wanted
- press Ctrl-F10 (or CD * in tcs' command line) to see all files again, wanted file is still selected
Copy and paste button-code:
a Test.cmd
a Test.txt
a Test.zip
Here is a trick from petermads' Extended Menus (https://ghisler.ch/board/viewtopic.php?t=33740)oko wrote: 2026-02-10, 20:33 UTC Is there possibility to go to file with different extension in file list?
" SHOW ONLY files with same name: CD "%O.*" "
Depending on what you do, maybe this helps too?
- select the file
- press the below button, to see all files with same name
- select the file you wanted
- press Ctrl-F10 (or CD * in tcs' command line) to see all files again, wanted file is still selected
Copy and paste button-code:
Code: Select all
TOTALCMD#BAR#DATA
cd
"%O.*"
TOTALCMD.EXE,4
Show only files with same name as the selected one(cd "%O.*")
0
-1Re: go to file with different extension
2Stefan2
It's not about showing only files with the same base name, but navigating to the next extension. —>
It's not about showing only files with the same base name, but navigating to the next extension. —>
For this, I've been using Ctrl+Shift+Down/Up myself for a long time (at first it was .vbs)
Last edited by Fla$her on 2026-02-11, 08:31 UTC, edited 1 time in total.
Overquoting is evil! 👎
Re: go to file with different extension
My posts are not for the original poster only, but for all casual readers.
Re: go to file with different extension
Hmm. This seems like an excuse for off-topic. I don't even see an auxiliary mechanism in such a recommendation.Stefan2 wrote: 2026-02-11, 08:20 UTC My posts are not for the original poster only, but for all casual readers.
Overquoting is evil! 👎
Re: go to file with different extension
No need for 3'rd party programs
You can put these three em_commands in your usercmd.ini file (located in the same dir as the current ini file):
Then you can use em_goto_next_ext or em_goto_previous_ext for keyboard shotcuts, or in buttons to go to the next or previous extension
You can put these three em_commands in your usercmd.ini file (located in the same dir as the current ini file):
Code: Select all
[em_hide_ext]
cmd=cd
param=%Z*|"*.%E"
[em_goto_next_ext]
cmd=em_hide_ext,cm_srcAllfiles
[em_goto_previous_ext]
cmd=em_hide_ext,cm_GoToPrev,cm_srcAllfilesLicense #524 1994
Danish TC Translator
TC 11.57b1 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1405a
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish TC Translator
TC 11.57b1 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1405a
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: go to file with different extension
But a plugin is not a third-party program. I'm just suggesting you look at the difference in the resulting quality. Otherwise, I wouldn't recommend it.
Not to mention that changing the current filtration can often be an undesirable and unexpected action.
My code will work even in quick filtering conditions.
Overquoting is evil! 👎
Re: go to file with different extension
It is still 3rd party that needs to be downloaded, installed and configured, and you'll need to edit totalcmd.inc after each update of TC.But a plugin is not a third-party program
Excellent, if you need that.Not to mention that changing the current filtration can often be an undesirable and unexpected action.
My code will work even in quick filtering conditions.
I am not belittling your solution, I am just giving and alternative generic solution, that might solve the oko's request in an easier way.
License #524 1994
Danish TC Translator
TC 11.57b1 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1405a
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish TC Translator
TC 11.57b1 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1405a
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: go to file with different extension
Downloading is not an argument. Would you call Imagine or Irfanview plugins third-party? After all, separate packages are also provided for them.It is still 3rd party that needs to be downloaded, installed and configured, and you'll need to edit totalcmd.inc after each update of TC.
And without settings, nothing will work in your case either. You don't have to edit totalcmd.inc after each update, only when new commands appear.
By the way, it only needs to be edited for clarity and for using the button [
Don't you need to?Excellent, if you need that.
I understand, but I suggest once again that you compare it experimentally to feel the value of a good choice.I am not belittling your solution, I am just giving and alternative generic solution
Last edited by Fla$her on 2026-02-11, 12:38 UTC, edited 1 time in total.
Overquoting is evil! 👎
Re: go to file with different extension
No, I don't need the function at all, in neither yours nor my implementation.Don't you need to?
I hadn't thought of the need for this until I saw this topic.
But the user has to check for new commands at new TC-updatesYou don't have to edit totalcmd.inc
License #524 1994
Danish TC Translator
TC 11.57b1 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1405a
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish TC Translator
TC 11.57b1 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1405a
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: go to file with different extension
Then it's clear. I thought you used this yourself, because the request itself (from other users) is very old for me. I use it relatively rarely myself.I hadn't thought of the need for this until I saw this topic.
For portable needs, we have to check a lot (localization files like menus, help files, etc.). We must not allow the replacement of icon libraries or something else. This is a natural process for a non-standard update, if it's not automated, of course.But the user has to check for new commands at new TC-updates
But as I wrote above, this is just an optional setting for activation. This will work too:
Code: Select all
[Shortcuts]
CS+DOWN=76553
CS+UP=76555Overquoting is evil! 👎
Re: go to file with different extension
thanks to all for answers.
To petermad: as I prefer non-3rd-party your solution would be sufficient for me, but it doesnt work always because after the filter is applied the cursor do not skip to immediately next visible file but second or so depending on how much files are hidden by filter. So after canceling filter the cursor may be on next or other next file type. Previous has the same unreliable results.
To flasher: The vbs would be better for me if it could work without installing plugin and inc changing.
To petermad: as I prefer non-3rd-party your solution would be sufficient for me, but it doesnt work always because after the filter is applied the cursor do not skip to immediately next visible file but second or so depending on how much files are hidden by filter. So after canceling filter the cursor may be on next or other next file type. Previous has the same unreliable results.
To flasher: The vbs would be better for me if it could work without installing plugin and inc changing.
Re: go to file with different extension
Do you have any problems with this? If you want quality (not only for this task, but also for many others), then you will have to install it.without installing plugin
There is nothing similar that will work better and faster, since the code and functions are already loaded into memory at the time of execution. This is better than using third-party processes.
But you can use the simple command chain. —>
527,525,3305,2053,524 — navigate to the file with the next extension
527,525,3305,2054,524 — navigate to the file with the previous extension
This is exactly the algorithm used on vbs when there were no command chains in TC yet.
It's not as clean and elegant, but it might suit you.
Overquoting is evil! 👎
Re: go to file with different extension
2Fla$her
Thank you. Your chain suits me, it is sufficient quality for me. It seems it works well. It cancels eventual selection but I dont mind (as far, practice will show).
Thank you. Your chain suits me, it is sufficient quality for me. It seems it works well. It cancels eventual selection but I dont mind (as far, practice will show).

