Set custom folder icons via internal associations

English support forum

Moderators: Hacker, petermad, Stefan2, white

KozakMak
Senior Member
Senior Member
Posts: 480
Joined: 2021-05-24, 12:39 UTC
Location: UA

Set custom folder icons via internal associations

Post by *KozakMak »

08.10.24 Added: Set custom folder icons via internal associations, only used when defining custom filter with advanced options "Attributes" and "Directory" checked (32/64)
Like this? -- https://ibb.co/1QYFDb7
And how can I do it?
OS: Win10 | TC: latest x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Set custom folder icons via internal associations

Post by *ghisler(Author) »

No, per folder icons could already be set previously, by setting the attribute to read only and adding a file named desktop.ini inside with content like this:
[.ShellClassInfo]
IconResource=c:\totalcmd\totalcmd.exe,0
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5747
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Set custom folder icons via internal associations

Post by *white »

KozakMak wrote: 2024-10-11, 06:30 UTC Like this? -- https://ibb.co/1QYFDb7
Yes, those folder icons.
KozakMak wrote: 2024-10-11, 06:30 UTC And how can I do it?
As described, create an internal association using a predefined selection type. When defining the selection you must specify on the Advanced tab to explicitly check for the Directory attribute.
KozakMak
Senior Member
Senior Member
Posts: 480
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: Set custom folder icons via internal associations

Post by *KozakMak »

2white
can you give me real example for [Associations] section pls ?
OS: Win10 | TC: latest x64
User avatar
white
Power Member
Power Member
Posts: 5747
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Set custom folder icons via internal associations

Post by *white »

KozakMak wrote: 2024-10-11, 11:06 UTC 2white
can you give me real example for [Associations] section pls ?
This example gives all folders named "bak" the Total Commander icon.

Code: Select all

[Associations]
Filter1=>bak folders
Filter1.icon=%commander_exe%

[searches]
bak folders_SearchFor=bak.
bak folders_SearchIn=
bak folders_SearchText=
bak folders_SearchFlags=0|002002000020||||||||22221|0000|||
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Set custom folder icons via internal associations

Post by *hi5 »

I tried the above already earlier but icon doesn't show in the folder list (both 32/64) are there any related settings that might need to be (un)set as well?
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
white
Power Member
Power Member
Posts: 5747
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Set custom folder icons via internal associations

Post by *white »

hi5 wrote: 2024-10-11, 20:06 UTC I tried the above already earlier but icon doesn't show in the folder list (both 32/64) are there any related settings that might need to be (un)set as well?
Are you talking about the internal association? Works for me. Did you restart TC?
BTW, I don't know if it is relevant, but there is a bug with the feature:
ghisler(Author) wrote: 2024-10-11, 10:06 UTC That did the trick for me, thanks! It's caused by the new function to set custom folder icons via internal associations. I will fix it.
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Set custom folder icons via internal associations

Post by *hi5 »

Yes, I copy what you have (which is what I already had but with different search and icon) and it doesn't work. I was just curious but I know how it looks as I've used the desktop.ini trick in the past and I don't care much for it. Strange that I don't see them but probably something very specific in my setup.
(changing the "icons" as in the other thread doesn't make a difference, even after restarting).
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Set custom folder icons via internal associations

Post by *petermad »

2hi5
which is what I already had but with different search and icon
Could you post the exact cod you are using? And give the name of the folder you want to set the icon for.
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
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Set custom folder icons via internal associations

Post by *hi5 »

I used the example posted by white, only difference is that I changed Filter1 to Filter15. I also tried it with a clean ini i/=icontest.ini and the icon doesn't show. Just the regular same old folder icons. Strange.
User avatar
white
Power Member
Power Member
Posts: 5747
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Set custom folder icons via internal associations

Post by *white »

hi5 wrote: 2024-10-11, 21:12 UTC I used the example posted by white, only difference is that I changed Filter1 to Filter15. I also tried it with a clean ini i/=icontest.ini and the icon doesn't show. Just the regular same old folder icons. Strange.
I assume you mean "/i=icontest.ini". That would result in c:\windows\icontest.ini being used, where you don't have write access..
Try for example: /i=%tmp%\icontest.ini
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Set custom folder icons via internal associations

Post by *hi5 »

You're correct, with /i=%tmp%\icontest.ini your example works. But in my regular c:\totalcmd\wincmd.ini with the exact same saved search/internal association: no icons. (To add: I created it in TC, not by editing the ini directly - having it seen in action now I don't think I will be using it but I can imagine people might enjoy it)
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Set custom folder icons via internal associations

Post by *ghisler(Author) »

Make sure you don't have multiple sections [Associations] or [Searches], because Windows can only handle one of each. If you already had such a section, you need to add the lines below the header to the already existing section. For example, if you already had a section named [Associations], you need to add the two lines
Filter1=>bak folders
Filter1.icon=%commander_exe%
below that existing header [Associations] and not add a separate section. Make sure to adjust the filter number, e.g. if you already had Filter1 to Filter5, you would need to change the above to:
Filter5=>bak folders
Filter5.icon=%commander_exe%
Author of Total Commander
https://www.ghisler.com
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Set custom folder icons via internal associations

Post by *hi5 »

I'm sure I only have only one section of each.

I now have a new problem, icons showing while they shouldn't viewtopic.php?t=84167
(I deleted all the tests via TC so BAK etc aren't there anymore in my wincmd)
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Set custom folder icons via internal associations

Post by *hi5 »

Issue fixed in 11.50b3 viewtopic.php?p=462209#p462209
Now folders have the correct icons when I do and do not want them - so the BAK example now works with my regular wincmd.ini
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Post Reply