2nd Edition
Copyright 1998-2000 Edward
L. Blake
All Rights Reserved
No part of this document may be reproduced in any form, mechanically or digitally, or transmitted or redistributed in any form by any means without the prior written permission from the author, Edward L. Blake. Edward Blake can be contacted at blakee@rovoscape.com
This article is an update to my previous postings on wotsit.org. This article is also better formatted as well. This will describe how the file is made on the disk, if your more interested in manipulating a URL file using the Windows IShellLink related interfaces from the source company of this file format. Then please see this link:
http://msdn.microsoft.com/library/psdk/shellcc/shell/Internet_Shortcuts.htm
Disclaimer: Please note that I am not the person, and
I’m not involved with the one(s), who made the URL format. The information
presented here is at most a description of how a URL file looks like and how to
read it based on my experimentation and experience.
The classic URL file format is pretty simple; it has a format similar to an INI file:
Sample URL File:
_______________________________________________________
[InternetShortcut]
URL=http://www.someaddress.com/
WorkingDirectory=C:\WINDOWS\
ShowCommand=7
IconIndex=1
IconFile=C:\WINDOWS\SYSTEM\url.dll
Modified=20F06BA06D07BD014D
HotKey=1601
_______________________________________________________
The syntax of the file format is like the following:
[Group\Section]
Field=Value
Field=Value
.
.
Each line terminates with CR and LF characters, and uses ANSI as it’s character set. The files can be manipulated using basic file I\O or the GetPrivateProfileString, GetPrivateProfileSection, WritePrivateProfileSection, WritePrivateProfileSring API functions provided by Windows.
The URL field is self-explanatory. It’s the address location of the page to load. It should be a fully qualifying URL with the format protocol://server/page. A URL file is not restricted to the HTTP protocol. In general, at least, whatever that can be saved as a favorite is a valid URL.
It’s the “working folder” that your URL file uses. The working folder is possibly the folder to be set as the current folder for the application that would open the file. However Internet Explorer does not seem to be affected by this field.
Note: this setting does not seem to appear in
some versions of Internet Explorer/Windows.
IconIndex
The Icon Index within the icon library specified by IconFile. In an icon library, which can be generally be either a ICO, DLL or EXE file, the icons are indexed with numbers. The first icon index starts at 0.
IconFile
Specifies the path of the icon library file. Generally the icon library can be an ICO, DLL or EXE file. The default icon library used tends to be the URL.DLL library on the system’s Windows\System directory
This field is generally the most cryptic of all the fields.
Example: Modified=20F06BA06D07BD014D
I’m not aware exactly how the date is encoded in the URL file format. However the code is clearly in a hexadecimal and is a counter, counting from a specific year, month and day. It also appears to be divided in 9 words. With some experimentation I was able to see the following:
Changes at a fast pace |
Changes slowly |
? |
||||||
20 |
F0 |
6B |
A0 |
6D |
07 |
BD |
01 |
4D |
The second character of the first word also never changes: possibly the resolution of the timer does not go this deep in detail. However the count is deep enough that it’s smaller than a microsecond (or it seems). To be useful, the words above have to have it’s order reversed, possibly the ninth can be removed. Therefore:
20 |
F0 |
6B |
A0 |
6D |
07 |
BD |
01 |
4D |
Invert |
Rem. |
|||||||
01 |
BD |
07 |
6D |
A0 |
6B |
F0 |
20 |
|
Then convert the first 4 words (most significant) from hex to a double precision number, do the same with the 4 last hex values (least significant), and apply the following formula:
MostSignificant = HexToDec(“01BD076D”)
LeastSignificant
= HexToDec(“A06BF020”)
BDN
= MostSignificant * 4294967295 + LeastSignificant
The following functions can be used as a “poor man’s” date approximation tool:
Year
= 1600 + Int(BDN / k / 1000 /
1000 / 60 / 60 / 24 / 356.25)
Month
= Int(BDN / k / 1000 / 1000 / 60 / 60 / 24 / 30 Modulus 12)
The k constant here is “guessed” as 10.2215, as it gave somewhat acceptably close months from 1995 to 2002. However it is far from being correct. While these functions are definitely crude, it provides a bit of insight how the Modified field was probably constructed. Creating your own functions to process these dates is recommended.
Recently, Mat Kramer has provided me with a possible explanation of the Modified field:
From:
"Kramer, Mat" <MKramer@datasci.com>
To:
Edward Blake
Subject:
URL File Format
Date:
Tue, 29 Aug 2000 12:22:19 -0500
Hello,
I
ran across your description of the URL format.
As far as the MODIFIED
field
goes, it is probably a FILETIME time stamp.
(From MS docs, The
FILETIME
structure is a 64-bit value representing the number of
100-nanosecond
intervals since January 1, 1601.)
There
is an MS article Q167296 that tells how to convert from this to a C
language
time_t.
Regards,
-
Mat Kramer <mkramer@datasci.com>
-
Data Sciences International, Inc.
(Nothing) - Normal
7 - Minimized
3 - Maximized
Note:
this setting does not seem to appear in some versions of Internet
Explorer/Windows.
The HotKey field specifies what is the shortcut key used to automatically launch the Internet shortcut. The field uses a number to specify what hotkey is used.
833 – Ctrl + Shift + A
834 – Ctrl + Shift + B
835 – Ctrl + Shift + C
.
.
1345 – Shift + Alt + A
1346 – Shift + Alt + B
1347 – Shift + Alt + C
.
.
1601 – Ctrl + Alt + A
1602 – Ctrl + Alt + B
1603 – Ctrl + Alt + C
.
Refer to Appendix A for a more complete table of hotkeys.
Sometimes the URL file will provide more information when it is saved as a Favorite with the following format:
[DEFAULT]
BASEURL=url
[DOC#n(#n#n#n…)]
BASEURL=url
ORIGURL=url
Sample URL File with extended URL fields:
_______________________________________________________
[DEFAULT]
BASEURL=http://www.someaddress.com
[DOC#4#5]
BASEURL=http://www.someaddress.com/frame1.html
ORIGURL=frame1.html
[DOC#4#6]
BASEURL=http://www.someaddress.com/frame2.html
ORIGURL=frame2.html
[InternetShortcut]
URL=http://www.someaddress.com/
_______________________________________________________
The purpose of these extra fields is probably for the browser to figure out what HTML documents were loaded in each frame, since the main URL tends to not record the state of it’s framesets. If you navigate to a framed site, click on a frame link (which changes one of the frames), and add the page to your favorites, the altered frame’s link is preserved. When a frame is nested inside another frame, the frame’s section name has the same first numbers, and another few numbers appended, like the following:
Sample URL File with extended URL fields and nested frames:
_______________________________________________________
[DEFAULT]
BASEURL=http://www.someaddress.com
[DOC#4#5]
BASEURL=http://www.someaddress.com/frame1.html
ORIGURL=frame1.html
[DOC#4#5#4#6]
BASEURL=http://www.someaddress.com/frame1a.html
ORIGURL=frame1a.html
[DOC#4#5#4#7]
BASEURL=http://www.someaddress.com/frame1b.html
ORIGURL=frame1b.html
[DOC#4#6]
BASEURL=http://www.someaddress.com/frame2.html
ORIGURL=frame2.html
[InternetShortcut]
URL=http://www.someaddress.com/
_______________________________________________________
“Make this page available offline”
Synchronization settings
Download Settings
Schedule Settings
It seems that Microsoft wants to hide the structure of the file format, even make it seem like it isn’t even a file at all. The URL file in the newer Microsoft Windows operating systems behaves almost like a LNK file. For example, in Microsoft Windows 2000 Professional, the URL file is treated like a shortcut, even in Windows Notepad, making the file format harder to be revealed and viewed. In order to view a file in these operating systems, use the DOS EDIT.EXE program. By typing EDIT in a command prompt window.
Creating and maintaining URL files using IshellLink related Windows interfaces
http://msdn.microsoft.com/library/psdk/shellcc/shell/Internet_Shortcuts.htm
Information on many other file formats
Email:
Primary Address: blakee@rovoscape.com
|
C+S |
S+A |
C+A |
C+S+A |
|
C+S |
S+A |
C+A |
C+S+A |
A |
833 |
1345 |
1601 |
1857 |
0 |
817 |
1329 |
1584 |
1841 |
B |
834 |
1346 |
1602 |
1858 |
1 |
818 |
1330 |
1585 |
1842 |
C |
835 |
1347 |
1603 |
1859 |
2 |
819 |
1331 |
1586 |
1843 |
D |
836 |
1348 |
1604 |
1860 |
3 |
820 |
1332 |
1587 |
1844 |
E |
837 |
1349 |
1605 |
1861 |
4 |
821 |
1333 |
1588 |
1845 |
F |
838 |
1350 |
1606 |
1862 |
5 |
822 |
1334 |
1589 |
1846 |
G |
839 |
1351 |
1607 |
1863 |
6 |
823 |
1335 |
1590 |
1847 |
H |
840 |
1352 |
1608 |
1864 |
7 |
824 |
1336 |
1591 |
1848 |
I |
841 |
1353 |
1609 |
1865 |
8 |
825 |
1337 |
1592 |
1849 |
J |
842 |
1354 |
1610 |
1866 |
9 |
826 |
1338 |
1593 |
1850 |
K |
843 |
1355 |
1611 |
1867 |
; |
954 |
1466 |
1722 |
1978 |
L |
844 |
1356 |
1612 |
1868 |
= |
955 |
1467 |
1723 |
1979 |
M |
845 |
1357 |
1613 |
1869 |
, |
956 |
1468 |
1724 |
1980 |
N |
846 |
1358 |
1614 |
1870 |
- |
957 |
1469 |
1725 |
1981 |
O |
847 |
1359 |
1615 |
1871 |
. |
958 |
1470 |
1726 |
1982 |
P |
848 |
1360 |
1616 |
1872 |
/ |
959 |
1471 |
1727 |
1983 |
Q |
849 |
1361 |
1617 |
1873 |
` |
960 |
1472 |
1728 |
1984 |
R |
850 |
1362 |
1618 |
1874 |
[ |
987 |
1499 |
1755 |
2011 |
S |
851 |
1363 |
1619 |
1875 |
\ |
988 |
1500 |
1756 |
2012 |
T |
852 |
1364 |
1620 |
1876 |
] |
989 |
1501 |
1757 |
2013 |
U |
853 |
1365 |
1621 |
1877 |
‘ |
990 |
1502 |
1758 |
2014 |
V |
854 |
1366 |
1622 |
1878 |
|
|
|
|
|
W |
855 |
1367 |
1623 |
1879 |
|
|
|
|
|
X |
856 |
1368 |
1624 |
1880 |
|
|
|
|
|
Y |
857 |
1369 |
1625 |
1881 |
|
|
|
|
|
Z |
858 |
1370 |
1626 |
1882 |
|
|
|
|
|
|
None |
Ctrl |
Alt |
Shift |
C+A |
S+A |
C+S |
C+S+A |
F1 |
112 |
624 |
1136 |
368 |
1648 |
1392 |
880 |
1904 |
F2 |
113 |
625 |
1137 |
369 |
1649 |
1393 |
881 |
1905 |
F3 |
114 |
626 |
1138 |
370 |
1650 |
1394 |
882 |
1906 |
F4 |
115 |
627 |
1139 |
371 |
1651 |
1395 |
883 |
1907 |
F5 |
116 |
628 |
1140 |
372 |
1652 |
1396 |
884 |
1908 |
F6 |
117 |
629 |
1141 |
373 |
1653 |
1397 |
885 |
1909 |
F7 |
118 |
630 |
1142 |
374 |
1654 |
1398 |
886 |
1910 |
F8 |
119 |
631 |
1143 |
375 |
1655 |
1399 |
887 |
1911 |
F9 |
120 |
632 |
1144 |
376 |
1656 |
1400 |
888 |
1912 |
F10 |
121 |
633 |
1145 |
377 |
1657 |
1401 |
889 |
1913 |
F11 |
122 |
634 |
1146 |
378 |
1658 |
1402 |
890 |
1914 |
F12 |
123 |
635 |
1147 |
379 |
1659 |
1403 |
891 |
1915 |