Favorites without baseurl

rctaubert

Member
Joined
Aug 22, 2004
Messages
24
Programming Experience
10+
I have so many IE Favorites it is getting hard to find the right one when I need it. I have an application in mind to sort all this out. However, I am finding that all the links stored in the Favorites directories (and sub-dirs) do not have a baseurl keyword inbedded in them. If you right-click the link and click properties you can find it there.

Does anyone know how to programmatically access the properties of the Favorites links using vb.net???
 
The Favorites are plain text documents with the data layed out like regular ini-files. The actual filename is 'favorite-text.url'.
Free "ini" classes exist on the web that does the standard work of accessing the sections and key/value pairs. Here for instance.
 
favorites without baseurl

Thank you for your response.

Let me be a bit more clear. I want to extract the actual url that the Favorite link takes you to.

I have randomly opened several .url files under Favorites with WordPad. Yes, some are formated like a .ini files, but some are in xml format. Also, some will store the url under the heading 'baseurl', some have 'url=', and others don't have the url in the text at all.

The only method I have found to consistantly see the true link to the website is to right-click on the .url file and select properties.

Since I cannot rely on the format of the .url file nor count on the actual url being present in the file I need help with read the file 'properties'.

If anyone has any ideas I would be very grateful. I'll even dance at your wedding.
 
The Favorites file format is not documented. As far as I know IE only uses the URL key in InternetShortcut section. I have never seen xml-code in such a file, but since IE ignores all other information in the file, it is convenient for other favorites management applications and other browsers to 'hook' into those files and put anything they want there, as long as the base structure of the file is not destroyed. It sounds to me as you have been using some of the mentioned software, and since you say not all favorites contain values in the URL key it could be that some of your favorites have been corrupted in IE regards.
 
favorites without baseurl

I have only used Internet Explorer. I haven't used anything else since it first came out. I even went back and looked at a few more .url files. I didn't look at many, but the newer ones seem to all be xml. There was at least one that didn't fit either xml or .ini format. Some have code in them, some don't have much of anything in them.

I don't know if any of the files have been corrupted, but they all work.

By the way, I have been doing computer support since the early 80s. Like we used to say in the service, I can take them apart and put them back together blindfolded. I am just new to vb.net.

Did you try right-clicking a .url file in favorites to see what I am talking about?? I contains the true url for the link and in many cases the number of times the site has been visited.

So, after all of this I guess you don't know how to access the properties of the file, but thank you any way.
 
rctaubert said:
So, after all of this I guess you don't know how to access the properties of the file
You must be kidding...
 
favorites without baseurl

No, I am not kidding. I am asking how to access the information you see when you right-click on the .url file. This appears to be information that does not necessarily show up inside the file. At least not as seen in a word processor.

So far you have described how you believe the file (as seen in a word processor) is formatted and that information is not consistent with what I am seeing.

You have not addressed the problem I am trying to solve so yes, that leads me to assume you don't know any more about it than I do.

But I do thank you for responding to my guery.
 
You are quite obvioulsy an experienced programmer, but do you need the base url or will the other one suffice? If so you can enumerate the folder and extract it's contents. Here's a snippet that will add info from the file to a tree view called tv. I havent done a lot of programming so if i've mis-understood your intentions i apologise. In addition JohnH has more than proved his ability on this forum as you can see from his status as moderator. In my opinion you'd do well to listen to him.

VB.NET:
Dim di As DirectoryInfo =  New DirectoryInfo(System.Environment.GetFolderPath(Environment.SpecialFolder.Favorites)) 
EnumerateFavorites(di)      
 
Private  Sub EnumerateFavorites(ByVal dii As DirectoryInfo)
    tv.Nodes.Add(dii.FullName)
   Dim i As Integer =  tv.Nodes.Count-1 
   Dim dI As DirectoryInfo
   For Each dI In dii.GetDirectories()
       EnumerateFavorites(dI)
   Next
 
   Dim fi As FileInfo
   For Each fi In dii.GetFiles()
           tv.Nodes(i).Nodes.Add(fi.FullName)
   Next
End Sub
 
favorites without baseurl

I really do appreciate the responses from both JohnH and from you.

My primary area of expertise is MS Access. I have used VB6 to perform various tasks associated with desktop computer support, lan management and small utilities for my own use. I have been building my own personal computers since 1977. But, I am totally new to VB.net.

I am only being honest when I say that neither of you have actually addressed the question I asked. Maybe I haven't explained it well enough.

I have over 200 bookmarks in Favorites in multiple directories. I keep them for my own use and to help answer queries from friends and relatives when they ask 'Where can I find ....'.

I use the sub-directories to try to organize them into categories. Unfortunately, many bookmarks fall into multiple categories and the bookmarks become obsolete. When you bookmark a page it appears that IE uses the TITLE as the name for the .url file. This is usally not very discriptive of the site. It has often been nothing more than 'Welcome'.

So, I am trying to write an applicaton to go through the Favorites folder (and sub-folders) collecting the name of each .url file and the final directory (my category) each file is contained in.

I then open & read the text from the each file, and attempt to extract the name (page title) of the .url file and the acutal url to the site (usually stored as 'baseurl =' or 'url='). This is where it gets frustrating. There is no consistancy to the way the .url files are formated. Some look like .ini files, some are in xml format and some seem to defie logic.

But I did find that if I use Explorer (not IE), right-click on the file the resulting pop-up window contains the baseurl as well as how many times I have visited that site. This baseurl DOES NOT always appear in the file when opened with a notepad or wordpad and the number of visits does not appear at all.

This leads me to believe that the information is stored as meta-data similar to how information (album, artist, etc.) is stored in music files (.wma). I have no clue how to access that information and that is the question I am trying to get an answer to. Without the actual url the .url file points to my app is useless.

So, I apologize if anyone has taken my responses the wrong way. It is very frustrating to ask a question, get a response that is nowhere near to what I have asked and then try to figure out how to redefine the question so it is better understood and still not get a proper response. This is why I don't use forums very often.

Again, thank you to both of you for trying.
 
rctaubert, I understand your question. This is comparable to getting the properties of a Word document via code for example (which is documented ;)).

Can you post an example of a url where the url in the actual file is different than what is shown in the properties of the favorite? I have looked through a handful of mine and they are the same.

One thing that I have noticed is that there is also a view count in which it would be nice to have access to.

I believe that some commercial bookmark managers gain access to that information somehow.
 
favorites without baseurl

I will use the most blatant offender. I have a link titled "Scratch Marks from Dennis Marks". When you double-click the .url it takes you to http://www.dcsi.net/~denmarks/. This is what shows up in the properties window.

By-the-way, I am using the term .url because I remember reading somewhere that .url is the extension of the favorite file as it appears in Favorites.

The contents of the file when opened with wordpad are listed below. As you can see the ONLY urls that do appear in the file pertain to the xml standard and are part of the document header. No other url appears in the link.

HTML:
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Scratch Marks from Dennis Marks</title>
<link rel="stylesheet" href="styles.css" type="text/css" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<script src="contents.js" type="text/javascript"></script>
<script src="calendar.js" type="text/javascript"></script>
<style type="text/css">
#mypicture {float: left; width: 85px; height: 110px; padding-right: 5px;}
#left {position: absolute; left: 0%; top: 0px; width: 30%; text-align: justify;}
#middle {position: absolute; left: 35%; top: 0px; width: 30%; text-align: justify;}
#right {position: absolute; left: 70%; top: 0px; width: 30%;}
#ltop {}
#lbottom {text-align: center;}
#rtop {width: 80%; border-style: solid; text-align: justify; padding: 10%}
#rbottom {text-align: center;}
#caldiv {text-align: center;}
#mailbox {visibility: hidden; font-size: 9pt;}
table {margin-left: auto; margin-right: auto;}
</style>
</head>
<body onload="createCalendar(y,m,d,true,'caldiv');cy=y;cm=m;">
<div id="maindiv">
<div id="left">
<div id="ltop">
<img id="mypicture" src="graphics/denmarks.jpg" alt="My Picture" />
<span class="font16">ABOUT ME</span><br /><br />
My name is Dennis. This is a personal site that covers some of my interests which currently are travel and computers. I have worked with computers for over 40 years. I'm always experimenting with HTML and javascripts. Pages may come and go without notice.
</div>
<div id="lbottom">
<br /><br />
<a href="javascript: cm--; if (cm<1){cm=12;cy--}; createCalendar(cy,cm,0,true,'caldiv');"><--</a><a href="javascript: cy=y; cm=m; createCalendar(y,m,d,true,'caldiv');">  TODAY  <a href="javascript: cm++; if(cm>12){cm=1;cy++}; createCalendar(cy,cm,0,true,'caldiv');">--></a>
<br /><br />
<div id="caldiv">Calendar loading ...</div>
</div>
</div>
<div id="middle">
<span class="font16">MY TRAVELS</span><br /><br />
I have traveled to Aruba, Austria, Barbados, Belgium, Canada, Cayman Islands, China, Denmark, Egypt, France, Germany, Greece (airport only), Grenada, Haiti, Hong Kong, Ireland, Israel, Italy, Jamaica, Japan, Liechtenstein, Luxembourg, Martinique, Mexico, Monaco, Morocco, Netherlands, Norway, Panama, Philippines, Portugal, Singapore, South Korea (airport only), Spain, Sweden, Switzerland, Taiwan, Thailand, United Kingdom (England, Scotland, Wales), United States of America, US Vigrin Islands, Vatican City, Venezuela, and Viet Nam (South).<br /><br /><br />
</div>
<div id="right">
<div id="rtop">
<span class="font16">WHAT'S HERE</span><br /><br />
To see the contents from any page, click show/hide menu in upper left.<br /><br />
Do you need a calculator that will calculate the number of subatomic particles it would take to fill the universe (110 digits)? If you do then go to my "Big Number" calculator. <br /><br />
What is your grandmother's sister's daughter to you? Go to "Relative Terminology".<br /><br />
Find and calculate any date in history. Go to "Date Calculator".
</div>
<div id="rbottom">
<br /><br />
<img src="graphics/mail.gif" alt="E-Mail" title="You must enter this into your email manually." />
</div>
</div>
</div>
</body>
</html>
 
Last edited by a moderator:
I can see why everyone is confused then. What version of IE are you using?

All of the favorites I have looked at on my system look like the following:
VB.NET:
[InternetShortcut]
URL=http://science.nasa.gov/RealTime/JTrack/3D/JTrack3D.html

There may be additional information added by other programs. For example one bookmark manager I have used adds the following:
VB.NET:
[InternetShortcut]
URL=http://science.nasa.gov/RealTime/JTrack/3D/JTrack3D.html
BMGUID={5D416EEF-A71F-4353-91E5-3822F1354A7D}

Your results actually look like it is the code from the site itself, not a link to the site.

If you could, open notepad, go to your favorites folder, and drag the favorite to notepad. I do not doubt you, I just want to see if the results are different than mine. Try a couple of other URL's. I am trying to see if your results are consistant.

Charles
 
Here is an other example with more details in the .url file. Note that the browser MyIE added some stuff.

VB.NET:
[InternetShortcut]
URL=http://go.microsoft.com/fwlink/?LinkId=30857&clcid=0x409
IconIndex=107
IconFile=C:\WINDOWS\system32\moricons.dll
Modified=904445BF7B52C5016B
[MyIE2]
VisitTimes=1
 
favorites without baseurl

Charles,

The information I sent in my last email was obtained by opening Notepad and then using file...open I opened file 'Scratch Marks from Dennis Marks'.

This time I did it the way you asked. I opened Notepad first, then did a 'drag' of file 'Scratch Marks from Dennis Marks' and 'dropped' it on the open Notepad.

Using that method I obtained the following:

[DEFAULT]
BASEURL=http://www.dcsi.net/~denmarks/
[InternetShortcut]
URL=http://www.dcsi.net/~denmarks/
Modified=C05305A064FCC501DE

So, now I am really confused. I have always believed that opening a file with Notepad by using File...Open was no different than dragging and dropping the file on notepad. Any idea why the big difference????? Now I feel that I can't trust what I see.
 
Back
Top