Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.

You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.

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?

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

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?

If I had the chops, I'd do it :-) However, I am at best a power user. I was just able to figure out how to adjust the script to do it's thing somewhere other than g:\apps (which it does as a default).

Is it possible to compile a VBScript to run as a Visual Basic .exe? If so, you can add in:- a user prompt for specifying directory- an option so the user can whether or not it is appropriate to recurse subdirectories- a cleanup option that runs through and deletes all desktop.ini files, or removes the icon entries in them

Another request, if there's room. I realize this one will require some further program logic:

If the first icon resource (exe) the script encounters does not have an icon present, move to the next resource. Good example: 7zip. The directory is full of headless exe's, but the one with the icon resources is the 7zFM or some such.

IconAnyFolder v0.1 - First Release (written in C#)Features- a user prompt for specifying directory- an option loop recursively into subdirectories- a cleanup option that runs through and deletes all desktop.ini files, or removes the icon entries in them- If the first icon resource (exe) the script encounters does not have an icon present, move to the next resource.

It sounds great! However, I don't actually care about the folders per se. However, I want to do something similar. I would like all of the subfolders in my Games start menu to have the actual icon for the game. I've done this manually for many of them and it is a pain as I have over 50 games installed.

Love your program and I have included a shortcut to the sendto menu on my computer.when I right click a folder and get to your program in the send to menu iconanyfolder opens up at the last folder that I had used with iconanyfolder. Instead of opening up with the folder that I had right clicked in the first place.It means having to scroll through the directories to find the folder that you want to action on.It would be good if that could be amended at some time as an enhancement.

nogojoe

Logged

Often the most convincing people are those who have lost the plot so much they don't recognize the difference between fact and fantasy

I was playing around with this app and changed the background on a folder, and now i canâ€™t read the text in that folder, and wanted to remove the background but cant.Anybody have any ideas on how to remove the background once itâ€™s been applied?