3

I have windows 7 and I have a little problem when change folders icon. I have an external hard disk and I have lots of icons on it. I want to change their icons.
this is content of my desktop.ini:

[.ShellClassInfo]
IconResource=\Picture\icons\ico183.ico

and this is attributes of my desktop.ini:

   SH        I:\Music\desktop.ini

I have mention all these icons were showing correctly but one day, they stop working:-(

**Note: ** Icons are in external HDD itself, so I can not use system icons. And because i have to move the HDD, I can not use system or any other icons on other systems.


I deleted icon cache and didn't help.
In Orgenize=>Folders and Search options => view => Always show icon...., I used both values (checked and unchecked) and didn't work.

17
  • Just some possible clues: back in XP, some of these icon changes via the ini would fail to work anymore when "autoplay" stuff is turned off. In 7 one type of registry icon refreshing was fixed by identifying the "icon location in the file" music.ico,0 (not sure if that is right) . Then there is the secondary desktop.ini showing up on 7 systems (not sure what that is about yet). The icon cache. 1 other weird bug like thing. Does it happen when you "clean" thumbnails, or other cleaner items ? Change Themes? Use a Themes package, that changes more than the themes?
    – Psycogeek
    Feb 20, 2012 at 8:11
  • @Psycogeek thanks, All icons were showing correctly and I gave my external HDD to my friend and it happened. So I didn't change anything, or haven't used any theme package and I did not clean thumbnails.
    – undone
    Feb 20, 2012 at 8:20
  • please add that additional info to the question. Try changing a few of the inis to reflect the icon location. this is one of mine IconResource=C:\Desk\Icon\Database\LCDPRES.ICO,0 As you can see I keep my own icon folder, so they don't get messed with. Then (assuming you can see system file) check for a second one on the disk. Then clear the iconcache. answers.microsoft.com/en-us/windows/forum/windows_7-desktop/… <-- full version of that. Reboot. if that dont work, Then use Ccleaner, and do a cleanup
    – Psycogeek
    Feb 20, 2012 at 8:28
  • @Psycogeek I've done that before and didn't work. As you can see, it's external HDD, so I have to use relative path and I can not use Icon's on my own system. and what type of info I should add?
    – undone
    Feb 20, 2012 at 8:40
  • I just noticed that the whole path is not defined in your ini, that could be smart, so they are on the drive itself you handed out? and as the disk name changes they still work on their system? Add the ----> ,0 <--- that tells the system which icon, in that file. If you Reset any one of them, using the system itself, does the system refresh that item proper? and does it hold past a re-boot?
    – Psycogeek
    Feb 20, 2012 at 8:41

4 Answers 4

2
+50

As requested, reposting as answer to claim the bounty. I guess the problem is related to the one described in this question.

I assume that using relative paths as described in the question above has solved the issue at hand.

2

I solved my problem by using Bhat's answer. Here is the answer: if you want to set an icon for a folder on a flash drive or external hard drive, you have to use a relative path. This is an example of the content of desktop.ini:

[.ShellClassInfo]
IconResource=\Picture\icons\ico183.ico,0

The desktop.ini file should be system and hidden file and SHOULD NOT be archive. You do this with cmd:

attrib +s +h -a desktop.ini

and the folder itself should be read-only:

attrib +r folder
1
  • 2
    I believe that the “Archive” attribute isn’t important.  I have functioning desktop.ini files that have the Archive attribute set, and Microsoft’s documentation mentions only the Hidden and System attributes. Oct 21, 2016 at 3:24
1

To be clear, the folders / files and their respective icons are stored on the external drive itself.

I have struggled with this myself in the past. There isn't really a way to do what you are asking - at least not in Windows - because each time you reattach the drive, the icons' locations get remapped. Even though the drive letter & order looks the same, something gets wiped / rewritten in the mappings for the drive.

3
  • my problem is no icon is shown only default folder icon. so there should be something wrong with desktop.ini. any suggestion?
    – undone
    Mar 1, 2012 at 19:36
  • @Death, yes, I completely understand. It is a "problem" but what I'm saying is that that's how Windows works (or not!). Nothing can be done, as far as I know from my own experience with it.
    – Joshua
    Mar 1, 2012 at 21:28
  • It was ok and every thing was fine, so there is nothing wrong with windows
    – undone
    Mar 1, 2012 at 22:38
1

To make it simple we can do it on multiples folders from some location.

Example, if you have lots of folders in a location (C:\Users\YOU\Videos) with files desktop.ini inside, just open a prompt (cmd) and go to that location (C:\Users\YOU\Videos), and then run the following MS-DOS comands:

REM Go to the location of all yours sub-folders
CD "C:\Users\YOU\Videos"

REM Seek and change attributes of *desktop.ini* inside all sub-folders
FOR /f %a IN ('DIR /A/D/B') DO ATTRIB +S +R -A +H "%a\desktop.ini"

REM Modify the attributes of all folders in your location
FOR /f %a IN ('DIR /A/D/B') DO ATTRIB +R "%a"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .