Welcome Guest.   Make a donation to an author on the site December 25, 2014, 01:54:45 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
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.
 
Read the full one-year retrospective report on DonationCoder.com.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Autopick custom icons for folders based on resources in folder  (Read 45009 times)
doctorfrog
Supporting Member
**
Posts: 134


see users location on a map View Profile Give some DonationCredits to this forum member
« on: February 01, 2008, 07:07:19 AM »

This is an idea I had a while back, and blogged about, back when I cared about blogs: http://doctorfrog.blogspo...t-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?
« Last Edit: February 21, 2008, 12:42:20 PM by mouser » Logged
jgpaiva
Global Moderator
*****
Posts: 4,719



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: February 01, 2008, 07:19:38 AM »

This can be done, it isn't much of a task and it's pretty cool Wink

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 smiley

What do you think?
Logged

gogogadgetscott
Supporting Member
**
Posts: 22



Mechanical engineer who has inexplicable knowledge

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: February 01, 2008, 08:31:57 AM »

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.in...uters/scripts/iconany.php


GoGoGadgetScott
Logged
doctorfrog
Supporting Member
**
Posts: 134


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #3 on: February 01, 2008, 10:13:37 AM »

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?
Logged
jgpaiva
Global Moderator
*****
Posts: 4,719



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: February 01, 2008, 10:16:04 AM »

Yep, doctorfrog, deleting the desktop.ini files should do the trick smiley
Logged

BigJim
Supporting Member
**
Posts: 178


I have seen the light!

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: February 01, 2008, 10:37:36 AM »

Barring the production of a formal app

Having done what you've already done ... why not follow through and create the app? It sounds pretty useful to me!
Logged

TruckerJim says "You can go down a hill too slow a thousand times. But too fast only once."
doctorfrog
Supporting Member
**
Posts: 134


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #6 on: February 01, 2008, 11:46:13 AM »

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

If not possible, well, shucks.
Logged
BigJim
Supporting Member
**
Posts: 178


I have seen the light!

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: February 01, 2008, 12:12:49 PM »

... well, shucks
Language!! We do have standards here, you know.  cheesy

I hear what you're saying. But there are lots of nice and talented folks here. One may take the baton. (hint!)  dance
Logged

TruckerJim says "You can go down a hill too slow a thousand times. But too fast only once."
gogogadgetscott
Supporting Member
**
Posts: 22



Mechanical engineer who has inexplicable knowledge

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: February 01, 2008, 12:17:34 PM »

I will happily convert to a desktop Visual Basic app. I like doctorfrog ideas and can easily implement. Does anyone have problem with a .net requirement?
Logged
doctorfrog
Supporting Member
**
Posts: 134


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #9 on: February 01, 2008, 12:49:10 PM »

I can live with it. ;-)
Logged
jgpaiva
Global Moderator
*****
Posts: 4,719



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: February 01, 2008, 01:10:16 PM »

I just gave it a go with ahk, and had the most frustrating hour ever!

After all, it looks like creating the .ini file isn't enough!!
And it looks like ahk has a huge stupid bug with file-pattern loops!!

Thus, i'm sorry but i can't keep this one.

gogogadgetscott: please do, amaze us! cheesy
Logged

doctorfrog
Supporting Member
**
Posts: 134


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #11 on: February 02, 2008, 09:30:23 AM »

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.
Logged
gogogadgetscott
Supporting Member
**
Posts: 22



Mechanical engineer who has inexplicable knowledge

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: February 04, 2008, 09:07:12 PM »

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.

* IconAnyFolder.zip (245.35 KB - downloaded 4881 times.)
Logged
mouser
First Author
Administrator
*****
Posts: 33,805



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: February 05, 2008, 07:55:35 AM »

Wow this looks great! how did i overlook this thread the first time!

gogogadgetscott, really nice work!  Thmbsup Thmbsup
Logged
doctorfrog
Supporting Member
**
Posts: 134


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #14 on: February 06, 2008, 12:39:23 AM »

Wow, a guy blinks and look what happens! Thanks a lot, Scott!
Logged
jojo99
Participant
*
Posts: 38

View Profile Give some DonationCredits to this forum member
« Reply #15 on: February 10, 2008, 05:08:34 AM »

Looks like you guys missed this program:
http://qad.donationcoders...com/wp/category/freeware/

I've been using this for a while and it works well.  Compared to te program in this thread, it doesn't loop through folders and sub-folders though.
Logged
jgpaiva
Global Moderator
*****
Posts: 4,719



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: February 10, 2008, 05:17:01 AM »

Now that's interesting... It's hosted on donationcoders and yet i had never heard of it! smiley
Logged

robinsiebler
Charter Member
***
Posts: 83



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #17 on: February 22, 2008, 05:28:14 PM »

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.
Logged

Happiness is laced with shards of pain
nogojoe
Charter Member
***
Posts: 136


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #18 on: February 27, 2008, 02:02:16 PM »

Hi
this is more for gogogadgetscott.

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
mouser
First Author
Administrator
*****
Posts: 33,805



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #19 on: February 28, 2008, 09:27:02 AM »

this was mentioned on Shell Extension City today -- congratulations to scott and everyone else involved.
Logged
SirSmiley
Member
**
Posts: 64


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #20 on: February 28, 2008, 05:07:20 PM »

Crap, mouser beat me to it! cheesy

Anyway Congrat's on the feature.  Thmbsup

Your original Vbscript is sexy clean.
Logged
kartal
Supporting Member
**
Posts: 1,529


View Profile Give some DonationCredits to this forum member
« Reply #21 on: March 21, 2008, 11:07:05 PM »

Very nice.
Logged
kartal
Supporting Member
**
Posts: 1,529


View Profile Give some DonationCredits to this forum member
« Reply #22 on: March 21, 2008, 11:10:42 PM »

I also wish that it would not change the modified date of the folder
Logged
hairball
Supporting Member
**
Posts: 3


View Profile Give some DonationCredits to this forum member
« Reply #23 on: May 27, 2008, 07:24:12 PM »

Hi all,

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?

Thanks!
Logged
SirSmiley
Member
**
Posts: 64


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #24 on: May 27, 2008, 07:58:00 PM »

Open the desktop.ini file and delete the background image or just delete the desktop.ini file.
Logged
Pages: [1] 2 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.047s | Server load: 0.08 ]