hidden files named "Icon?" on my macbook pro cannot be removed [duplicate]

In some of the folders, there is a hidden file Icon? (filesize 1.3MB; not icon of file, but filename being Icon?). Once I rename or remove it, it appears immediately again.

What created these Icon? files and how to remove them thoroughly?


Solution 1:

These files are created when the folders containing them have custom icons.

The files are normally hidden in the Finder, and only appear if you enable showing hidden files.

If you want to remove them, Get Info on the enclosing folder, select the icon of the folder, and Press Delete. This will delete any custom images.