4

My site has an option to download a shortcut (.url) file onto the user's PC by clicking a link. The idea is that users then can save this to their desktop, and use it a shortcut to the site for future visits. (I know it's wacky, but it's what my client wanted.)

I have an icon(.ico) file that I wish to use, but whenever the user downloads the file the icon is not shown.

I've tried opening the URL file in notepad and editing the IconFile value to point to the icon file on the server itself.

[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://example.com/
IDList=
HotKey=0
IconFile=http://example.com/favicon.ico
IconIndex=0

However this does not seem to work. Can anyone suggest what might be wrong, or how I can fix it.

Urbycoz
  • 7,247
  • 20
  • 70
  • 108

1 Answers1

5

MS Windows does not load icon files specified with ´IconFile´ from the internet (for security reasons, I guess).

Rather it only loads the ´IconFile´ from

  • local file if the path is a file path, or
  • local web cache if the protocol is http:

You can verify this by navigating Internet Explorer to http://example.com/favicon.ico (now file is in cache) and then refreshing your *.url file (by right-clicking -> Edit -> [Make a fake change])

Now the icon should be displayed. Now clear your IE-cache, refresh *.url file, and the icon is gone (replaced by the icon of the default browser)

So,

  • either your client can tolerate that the default icon is displayed if icon is not cached, or
  • you have to provide a local copy.
Wolfgang Kuehn
  • 12,206
  • 2
  • 33
  • 46
  • I'm not getting the behaviour you describe. When I navigate in IE to the .ico file, then make a change to the url file, the icon remains the default browser icon. – Urbycoz May 29 '14 at 12:19
  • I've just tried on a different server and I _do_ get the behaviour you describe there. Just using the browser's cache is sufficient for me- I just want it to do that on both servers. It seems like there's something stopping it being cached. – Urbycoz May 29 '14 at 12:34
  • Please check the `Temporary Internet Files` folder for the *.ico file. If it's not there, then caching is disabled. – Wolfgang Kuehn May 30 '14 at 10:00
  • Weirdly the .ico file is there for the one server, but not the other. Is there some way the server itself could be preventing the icon getting cached? – Urbycoz May 30 '14 at 12:12
  • Try to delete all temporary Internet files through the tools menu and reload the icon. I believe you cannot switch off caching completely in IE, so the icon should show up. – Wolfgang Kuehn May 31 '14 at 10:47
  • Aha. It seems to be working now. Thanks for your help. – Urbycoz Jun 02 '14 at 09:17