7
4
When I save a shortcut from Firefox to disk, this is its contents when viewed in a text or hex editor.
[InternetShortcut]
URL=http://superuser.com/
IDList=
HotKey=0
IconFile=C:\Users\Jerry\AppData\Local\Mozilla\Firefox\Profiles\e8oe2h15.default\shortcutCache\ndPGaHoK9RbB9Xs6pYDwiA==.ico
IconIndex=0
It appears very simple: plain text with some markup in a file.
Let's say I want to recreate this file manually.
- I create an empty text file.
- I paste the contents above into it.
- .. save the file and exit the program.
- .. change the file extension from txt to url.
- .. accept the risk of loosing file type association by clicking YES when prompted.
Now, I would expect to be able to open this file in my default web browser by double clicking on the file icon. But no, it doesn't work like that. Instead, I receive an error message.
The target "" of this Internet Shortcut is not valid. Go to the Internet Shortcut property sheet and make sure the target is correct.
What exactly is meant by target ""
?
By searching here on the site, I can see that several other users have stumbled upon this or similar difficulties with Internet Shortcut files, and some have even attempted to create "cross platform" Internet Shortcut files. What I don't see is why this is such a pain in the first place.
It's supposed to be just a simple file with a URL address that opens in a web browser. So what makes these "Internet Shortcut" files special? What makes them tick? When I compare my file with the original, they appear to be identical. So where exactly is the problem then?
Update
Here's some interesting findings. The word "target" likely means URL, and "Internet Shortcut property sheet" most probably refers to "Web Document" tab on the file properties dialog box. If I remember correctly it was titled "Internet Shortcut" in previous versions of Windows (in Windows 98 at least). It appears to have been renamed to Web Document since then.
There is more to it! As can be seen from the screenshots below, my file shares the same SHA1 digest as the original. But it does not share the same file icon, nor does it have the "Web Document" tab.
What's even more is that when I rename my new file so that it begins with an upper case letter, it becomes a functional Internet Shortcut file. Just like that! It just starts working. If I rename it again, so that it starts with a lower case letter, it stops working... again. Don't take my word for it, have a look at the screenshot below.
It also helps starting the file name with an underscore, a dash, a point, a parenthesis, curly brace, square bracket, equal sign, number sign, exclamation mark, and so on. It even properly replaces the globe icon with a blank paper sheet icon. Renaming it to anything other than test
or Test
really changes the icon.
But what's causing it to behave or misbehave like this? For instance, why would it matter if the file name begins with an upper case letter? There is no such limitation for regular files...
Update 2
If the new file's name starts with an upper case letter, prior to changing the name extension, and then gets renamed so that it starts with a lower case letter... then it still works!
So if you go about it like this, it will work:
newfile Lancelot.txt
pastein Lancelot.txt
rename Lancelot.txt Lancelot.url
rename Lancelot.url lancelot.url
Update 3
It is likely that the original problem with the test.url file occurred at step 4 above. I had initially created a file named test.txt on a different disk and renamed it test.url. This was before I created a second file with the same name on the system disk in Desktop folder (as depicted above). I do not recollect, but it is likely that I initially created a file, changed the name extension, and then pasted in the target URL and saving it and hoping for it to work by a simple double click. As opposed to creating the file, pasting in the target URL, and then changing the name extension.
I can see nothing wrong with your method. It works here using your copy/paste [aside from a missing icon, of course] - target"" is what should be listed for
URL:
in Web Document when you open the property sheet… here that correctly showshttp://superuser.com
. I'm testing on WIn7 though, don't have 8.1 to try. – Tetsujin – 2015-04-07T09:46:11.237@Tetsujin Check your file name. Does it start with an upper or lower case letter? If upper case, try lower case. Else... then that's really strange. – Samir – 2015-04-07T10:26:12.200
I have one called 'net shortcut.url' & another simply called 'New Text Document` - windows seemingly is hiding the .url even though I have it generally set not to; I did initially change .txt to .url – Tetsujin – 2015-04-07T10:35:12.030
Never mind. I lost track of things. I now started off with a
baby boy.txt
file and renamed it tobaby boy.url
and it worked. I renamed it again to saybaby.url
(extension hidden) and it still worked, as didBaby.url
. I figured it might have to do with using more than one word for name. Now all of a sudden I was able to create a blanktest.txt
and past into that and rename it totest.url
and it worked. Huh?! I have no idea what's going on here anymore. Behavior appears to vary by the weather. It was sunny before, but clouds are building up now and it might start to rain. – Samir – 2015-04-07T11:01:29.1001Just to verify I did a reboot and yes, I can now create
test.txt
and rename it totest.url
and it will work. Go figure! It would appear that previous "baby boy" in a file name somehow set it straight. Windows got offended? – Samir – 2015-04-07T11:10:26.553I can now even remove all contents from the file
test.url
so that it becomes 0 byte, and it will still work. As long as the name extension is kept and "Web Document" tab is unchanged. This is a sorry excuse for a file type. – Samir – 2015-04-07T11:16:09.267