The .url file doesn't load the icon
Asked Answered
S

5

7

I have developed a servlet that generates a .url file and send it to the user. The target is to let the user access to the web application without entering the username and password data, by double-clicking the .url file downloaded. The .url File has the following format:

[DEFAULT]
BASEURL=http://{SERVER}/login?action=directAccess&userName={USERNAME}&passw={ENCRIPTED_PASSWORD}
[InternetShortcut]
URL=http://{SERVER}/login?action=directAccess&userName={USERNAME}&passw={ENCRIPTED_PASSWORD}
IconIndex=0
IconFile=http://{SERVER}/resources/favicon.ico 

I know that this solution only works in Windows OS but I have no problem with this because all the clients that use the web application use windows as OS.

The problem is that the .url file downloaded doesn't load the icon indicated on the file in some cases ( Windows 7 or higher OS), so the icon showed is the default browser icon. Is there any solution?

Thx very much!

Siriasis answered 24/9, 2013 at 8:40 Comment(0)
R
4

I believe this issue is based on Windows 7 and newer using a .website file and not a .url file. Here are examples of both using google.com.

.url syntax:

[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11
[InternetShortcut]
IDList=
URL=https://www.google.com/

.website syntax:

[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11
Prop4=31,Google
[InternetShortcut]
IDList=
URL=https://www.google.com/
IconFile=https://www.google.com/favicon.ico
IconIndex=1
[{A7AF692E-098D-4C08-A225-D433CA835ED0}]
Prop5=3,0
Prop9=19,0
[{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}]
Prop5=8,Microsoft.Website.9CB8E698.C9795A8C

A .url file will simply download the /favicon.ico of the site if available, but fall back to the http icon of your default application (Chrome or IE's icon, etc). A .website file you can specify the icon to use including providing higher quality icons that wouldn't be included in the favicon.ico file. The downside to using a .website file is that it will open IE and not the user's default web browser. The upside is you get a custom icon and possibly more functionality because you can have jump lists, badges, etc. IE Dev Center

Roeder answered 29/1, 2014 at 1:9 Comment(1)
thank you for your coment ManOVision, but this answer doesn't solve my problem. I need the icon open the user's default web browser. But it was useful learn about the information you provided.Siriasis
E
2

The IconFile needs to be accessible within the filesystem. That said, either find a way to download it locally (e.g., while installing a corporate package) or make it available within a file share (which, although remote, is treated in a special way by Windows). That cleaver trick would result in:

IconFile=\\{SERVER}\resources\favicon.ico 

It assumes the same webserver is available online (or within your Intranet, depending on target audience) and has a file share named resources (proper share and file permissions and firewall adjustments necessary) pointing to the same location served by the referred HTTP address.

Reference: Distributing an Internet Shortcut file with a custom icon

Estelleesten answered 4/6, 2019 at 7:49 Comment(0)
G
1

To work around this problem, set the icon path of the Internet shortcut manually. To do this, follow these steps:

  1. Right-click the Internet shortcut, and then click Properties.

  2. Click the Web Document tab, and then click Change Icon.

  3. Locate the folder that contains the icon, and then click the icon for the Internet shortcut.

It works even if it is a document for IE7

Reference: https://support.microsoft.com/en-us/help/935779/fix-an-internet-shortcut-does-not-display-the-correct-icon-in-internet-explorer-7

Germanium answered 20/4, 2017 at 8:48 Comment(0)
C
0

it all started for me when i deleted internet explorer. Then chrome could not load url:s as previously. Solution was reinstall internet explorer. Associate urls with explorer and then finally back to chrome. Select open with explorer or chrome to change these assocications.

Calaverite answered 5/10, 2020 at 23:29 Comment(0)
K
0
  • Type "Default app settings" in the Windows search bar.
  • Click "Choose default apps by file type."
  • Scroll down to .URL and change the default to "Internet Browser."
Kone answered 19/9 at 17:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.