ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

DONE: Autopick custom icons for folders based on resources in folder

(1/6) > >>

doctorfrog:
This is an idea I had a while back, and blogged about, back when I cared about blogs: http://doctorfrog.blogspot.com/2005/04/wanted-folder-art-collector-software.html

Basically, I want a function similar to the way Windows will sometimes change folder icons based on what's inside them, except I want the .ico or .exe icons present inside the folder to be used instead of icons of stock images of music notes or flowers. This is one of those things that sounds simple to a non-programmer, lucky me if it actually ends up being simple to execute.

There are a few (somewhat more complicated) extensions to this idea as well (consider them nice-to-haves):
- if the resources within the folder are image files, auto-pick one of them and create an .ico from it, then apply as custom folder icon
- offer ability to create rules to apply stock icons based on the majority file types within the folder (ie. if the folder contains mainly .mp3s, apply a certain icon image)
- ability to recurse and apply icons for subdirectories, or only apply to the top tier of directories the application is aimed at
- support for creating/scaling very large icon files, for those persons who pump up their icon sizes beyond 32x32

Here's a copy of my original blog post blatherings:

I wasted some time late last week picking custom icons for some folders on my Windows XP box:



Avoiding actual work, I headed over to my games folder and started doing the same:



And I noticed something. Mostly, to pick an icon, you go to the only .exe in the folder, or the only .exe with an embedded icon, or the only .ico in the folder, and select it as your folder icon. It is a repeated, mechanical process, something that can be handled with a fairly simple program.

Such a program can be sent to crawl among a top-layer collection of folders, crib the most likely icons to be used for the folders, and present them to the user for approval, similar to Album Cover Art Downloader. If no appropriate icons are found, the program can offer a standard selection of icons from a specified .icl or folder full of icons (I'm partial to foood's delicious icons, as shown above).

All of the icons in the second image above exist in their respective folders, and are, in most cases, the only icons in the folder. They'd be ideal for this program, since they can be automatically assigned. If there are other icons in the folders, the program can just pick one and present it, along with alternate icons, for approaval, similar to Album Cover Art Downloader. I keep a bunch of general-purpose icons in a folder, and Windows of course has its Shell32.dll. If no icons are found to autopimp the folder (hey, hey! great software name!), these resources can be presented to the user to hand-pick an icon.

The following logic can be applied to automatically pick the 'correct' icon:
If there is only one icon available (.ico, .icl, .exe), use it. Otherwise: Use the icon with the highest resolution, most colors, etc. (This avoids picking an icon from a .exe that isn't the main program in the folder, since icons designed to represent a program usually contain multiple resolution and color depth versions, and 'helper'programs are often given a more generic icon.)

Does something like this exist? And, am I the only one who thinks it should?

jgpaiva:
This can be done, it isn't much of a task and it's pretty cool ;)

The icon of the folder is stored under a hidden system file inside that folder called desktop.ini.
Thus, changing the info on that file is pretty easy.

Now, the big problem i can see, is when there are several icons/executables on the same folder. Also notice that if you have 2 icons with a different name, they'll be identified as being a different icon even if the image is the same (fixing this isn't trivial).

So... My option would be: for a first version, make it add the first icon/executable it finds or instead, if there are multiple choices, add none. And for a next version, we could add something like a popup asking the user to choose between the icon options on the folder.

Regarding the "extras"... Only the option on recursion is trivial, the first one is complex, the second one is doable (depends on how much attention the app gets), and the fourth one... I don't think i get what you mean :)

What do you think?

gogogadgetscott:
I created a VBScript awhile back that does something like this. Let me know what you think. I am happy to revisit it and make updates.
http://gogogadgetscott.info/computers/scripts/iconany.php


GoGoGadgetScott

doctorfrog:
That's pretty decent there, Scott, and embodies my idea well. Barring the production of a formal app, I think I can make do with this. I suppose I could remove the customization by finding all desktop.ini files in a directory structure and deleting them?

jgpaiva:
Yep, doctorfrog, deleting the desktop.ini files should do the trick :)

Navigation

[0] Message Index

[#] Next page

Go to full version