Auto Switch Mode: how to hide certain type of file automatically?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

Auto Switch Mode: how to hide certain type of file automatically?

Post by *byblo »

Is there a way to select files type to automatically hide with the "Auto Switch Mode" ?

For instance, to hide automatically SFV files when entering on a certain folder, instead of manually pressing CTRL+F12, then select "*.*|*.sfv"
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Auto Switch Mode: how to hide certain type of file automatically?

Post by *petermad »

Make this command in your usercmd.ini file:

Code: Select all

[em_hidesfv]
cmd=cd *.*|"*.sfv"
iconic=1

Make this entry in your wincmd.ini file (replace 16 with the next free number in your [ViewModes] section)

Code: Select all

[ViewModes]
16_name=Hide .sfv
16_icon=
16_commands=*em_hidesfv|cm_SrcAllFiles
16_options=-1|-1|0||-1|-1|-1

Make this entry in your wincmd.ini file (replace 16 with the number from your [ViewModes] section) - you should make it one of your first rules

Code: Select all

[ViewModeSwitch]
1_rules=?*.*\*.sfv
1_mode=16
Screenshots:
http://madsenworld.dk/tcmd/hidesfv1.png
http://madsenworld.dk/tcmd/hidesfv2.png
http://madsenworld.dk/tcmd/hidesfv3.png


You could also just put *.sfv in the Ignore list: "Configuration" -> "Options..." -> "Ignore list"
http://madsenworld.dk/tcmd/hidesfv4.png
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
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

Re: Auto Switch Mode: how to hide certain type of file automatically?

Post by *byblo »

Thank you for the comprehensive answer :)
User avatar
Wojtek
Junior Member
Junior Member
Posts: 72
Joined: 2010-02-07, 11:58 UTC
Location: Germany

Re: Auto Switch Mode: how to hide certain type of file automatically?

Post by *Wojtek »

I have exactly the same question, but I'd like to know how to set up TC using dialog boxes instead of manipulating the *.ini files.

This is what I've set up:
custom user command em_HideFileTypes
with the command CD *.* | "*.bak *.tmp"
and set up Auto Switch Mode to ASM1 when directory XYZ is detected
but the file types (*.bak and *.tmp) are still visible

What did I do wrong?
Asus Maximus VIII Hero · Win10 Pro x64
Crucial MX500 1TB SSD · 64GB Corsair Vengeance LPX · nVidia GeForce RTX 3060 · Intel i7 7700K

Lenovo ThinkPad X1 Yoga 2.Gen · Win10 Pro x64
512GB SSD · 16GB RAM · intel HD620 · i7-7600U

TC 11.03 32-bit #347308
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Auto Switch Mode: how to hide certain type of file automatically?

Post by *ghisler(Author) »

Change the user command to
cd *.* | *.bak *.tmp
Author of Total Commander
https://www.ghisler.com
User avatar
Wojtek
Junior Member
Junior Member
Posts: 72
Joined: 2010-02-07, 11:58 UTC
Location: Germany

Re: Auto Switch Mode: how to hide certain type of file automatically?

Post by *Wojtek »

ghisler(Author) wrote: 2024-10-09, 12:43 UTC Change the user command to
cd *.* | *.bak *.tmp
Many thanks, works as it should!

One more thing:
How can I modify my user command?
There seems to be no way to pop up a "command editor" window.

What I do now as a workaround:
1. MENU: Configuration > Options
2. Go to TAB: View Mode > View Modes: select View Mode "XY"
3. Go to FIELD: Auto-run commands > press button [+]
4. Select Category: usercmd.ini
5. Select user Command "XY"
6. Press [Edit...]

Is there something less time-consuming?
________________________________________
EDIT:
Unfortunately the view mode does not switch back when I change the directory. The FileType filter stays active
Any ideas?
Asus Maximus VIII Hero · Win10 Pro x64
Crucial MX500 1TB SSD · 64GB Corsair Vengeance LPX · nVidia GeForce RTX 3060 · Intel i7 7700K

Lenovo ThinkPad X1 Yoga 2.Gen · Win10 Pro x64
512GB SSD · 16GB RAM · intel HD620 · i7-7600U

TC 11.03 32-bit #347308
User avatar
white
Power Member
Power Member
Posts: 5748
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Auto Switch Mode: how to hide certain type of file automatically?

Post by *white »

Wojtek wrote: 2024-10-09, 15:49 UTC How can I modify my user command?
There seems to be no way to pop up a "command editor" window.
cm_CommandBrowser ?
User avatar
Wojtek
Junior Member
Junior Member
Posts: 72
Joined: 2010-02-07, 11:58 UTC
Location: Germany

Re: Auto Switch Mode: how to hide certain type of file automatically?

Post by *Wojtek »

white wrote: 2024-10-09, 21:42 UTC
Wojtek wrote: 2024-10-09, 15:49 UTC How can I modify my user command?
There seems to be no way to pop up a "command editor" window.
cm_CommandBrowser ?
That's what I was looking for. Thanks!

Any ideas why the View Mode "gets stuck" after changing the directory?
Asus Maximus VIII Hero · Win10 Pro x64
Crucial MX500 1TB SSD · 64GB Corsair Vengeance LPX · nVidia GeForce RTX 3060 · Intel i7 7700K

Lenovo ThinkPad X1 Yoga 2.Gen · Win10 Pro x64
512GB SSD · 16GB RAM · intel HD620 · i7-7600U

TC 11.03 32-bit #347308
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Auto Switch Mode: how to hide certain type of file automatically?

Post by *petermad »

Any ideas why the View Mode "gets stuck" after changing the directory?
Because you probably don't have a rule that is activated when you leave the directory, and because you have changed the file type, which by itself can not be reset by the standard options for a View mode.

You have to reset the file type when you leave the dir, with a command - so put |cm_SrcAllFiles after your em_command in the "Auto-run commands" field. The | indicates that the following command must be executed when you leave the View mode. The cm_SrcAllFiles command will then show all files again.
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
Post Reply