How to force windows to show new icons?

7,643

Solution 1

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

Solution 2

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.

Solution 3

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"

Solution 4

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.

Share:
7,643

Related videos on Youtube

undone
Author by

undone

Updated on September 18, 2022

Comments

  • undone
    undone over 1 year

    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.

    • Psycogeek
      Psycogeek about 12 years
      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?
    • undone
      undone about 12 years
      @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?
    • Psycogeek
      Psycogeek about 12 years
      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?
    • undone
      undone about 12 years
      @Psycogeek yeah , they worked well on any system before but now it's failing!
    • Psycogeek
      Psycogeek about 12 years
      Folder view? Menu Organize / folder and search options / View tab/ the icon and thumb items in there?
    • undone
      undone about 12 years
      @Psycogeek Sorry, I didn't understand what you mean(last comment).
    • Psycogeek
      Psycogeek about 12 years
      From an Explorer window , go into the Organize menu. . I Just looked in the registry looks like 2 changes made there in the "Bags" bags/bagmui, around here HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\Shell\BagMRU , and the bags for the user. The Bags is what stores ALL the window locations and settings. Ccleaner can clear "bags", but it WILL reset all your windows :-(
    • undone
      undone about 12 years
      @Psycogeek I tested it on both using icon and using thumbnails and both didn't work!
    • Psycogeek
      Psycogeek about 12 years
      Keep updating your question. so someone can come along and answer It based on the question, and not the noise in the comments. It is important you put in the Q what you tried and did not work . . This is only effecting that One drive right? and not other icons in the system?
    • undone
      undone about 12 years
      @Psycogeek Sorry, what do you mean by This?
    • Psycogeek
      Psycogeek about 12 years
      2 things. Are most of your Icons Ok? Did you change them via the systems gui method for changing them, to test?
    • undone
      undone about 12 years
      @Psycogeek Icons are ok, all of them, I checked several times. And there is no way (at least I don't know any) to do it using gui because I need relative path not absolute.
    • Richard Hpa
      Richard Hpa about 12 years
    • undone
      undone about 12 years
      @BhargavBhat Thanks a lot, problem solved. post as answer, and bounty will be yours:)
  • Joshua
    Joshua about 12 years
    @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.
  • undone
    undone about 12 years
    It was ok and every thing was fine, so there is nothing wrong with windows
  • Scott - Слава Україні
    Scott - Слава Україні over 7 years
    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.