Jump to content

How to reload icons on desktop


Recommended Posts

Hi all,

I am overwriting a shortcut on the desktop with a new shortcut pointing to the same (but updated) .ico file. Problem is, the old picture is still showing in stead of the new picture. This is probably because the old picture is in the icon cache.

Does anyone know how to update the icon cache using AutoIt ? The EnvUpdate ( ) function doesn't do the trick.

BTW, I do know when the picture is updated: using TweakUI Rebuild Icons or change the icon size at the display settings.

Perhaps there is a way I can do this with a DllCall?

I hope someone can help.

Thanks! Mark

Link to comment
Share on other sites

Hi Mark,

There is a hidden icon cache file in your windows directory, ShellIconCache, which contains a copy of all the default desktop icons. It sometimes gets corrupted. If it does, your icons will go all black or they may display the wrong icons. If this happens, delete it and reboot. NT (& Win9x) will repopulate the cache with the default icons. To delete the ShellIconCache:

* at a command prompt, change to the %SystemRoot% folder

* remove the hidden attribute from the file:

type attrib -h shelliconcache and press ENTER.

* delete the file:

type del shelliconcache and press ENTER.

* logoff and backon and the default icons should be restored.

TweakUI has been known to corrupt the ShellIconCache.

This tip applies to all versions of Windows including Windows NT, Windows 2000, and Windows XP.

Ps. Great tool the HitmanPro.....

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

    type attrib -h shelliconcache and press ENTER.

Hi Andre,

Thanks for the quick response :) Fortunately, it does not work. There is no such file called shelliconcache on (my) Windows XP (looked into that yesterday). But there is an IconCache.db at %UserProfile%\Local Settings\Application Data. Deleting it and refreshing the desktop does not solve the problem either. And I wish to update the icon picture without needing to log off. Perhaps you or someone else have another idea?

Thanks! Mark

BTW, this small problem is indeed concerning my program Hitman Pro :D

Edited by markloman
Link to comment
Share on other sites

Hi Mark,

you are overwriting the old shortcut ?

What about trying to delete it first, refresh and then create an new one ?

ps. Did not test it myself.

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

you are overwriting the old shortcut ?

What about trying to delete it first, refresh and then create an new one ?

That doesn't work either. But deleting the IconCache.db and reboot the computer will automatically recreate the cache and the new icon will be displayed. Would rather have the icon without rebooting. But it'll do for now. Perhaps someone has an idea.

Thanks! Mark

Link to comment
Share on other sites

Kill explorer.exe ?

Removing IconCache.db and restarting explorer.exe does the trick. It's not the nicest manoeuvre but I will implement it (only resetting explorer.exe once when a new icon exist). Thanks!

Edited by markloman
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...