Knowledge Base

SAMPLE: FAVREAD Reads Internet Shortcuts from Favorites Folder

Article ID: 178380

Article Last Modified on 8/11/2004


APPLIES TO


This article was previously published under Q178380

SUMMARY

The Favorites Reader is intended as a demonstration of some of the basic Shell APIs, particularly the determination of URLs from Internet Shortcuts. Favorites Reader is a generic iterator of any set of shell folders and subfolders but its main focus is to provide the links from the user's Favorites Folder.

The original intention for this object was to make it easy to add a list of favorite links to a Web site, most likely using the Active Server Pages (ASP) feature of Internet Information Server (IIS). What better place to find an ever-changing, up-to-date list of favorite links than in your own Favorites folder?

The following files are available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

MORE INFORMATION

NOTE: This sample requires header files from the Internet Client SDK (InetSDK). It may not compile or build without modification on systems that do not have the InetSDK.

To Use

  1. Copy the Favorites.asp file to an appropriate location in your Web site's directory.
  2. Modify the line reading the following near the end to point to the path of a particular Favorites folder on a computer that you want to display:
    <% Fav.AltPath = "<Path To Your Favorites Folder>;" %>
    					
  3. Give read access privileges to IUSR_ComputerName for the Favorites folders so that the protected process of ASP can access and read the Internet Shortcut files. (Lack of access rights is the most likely cause of problems with FavRead.)
  4. Navigate to that ASP page on the Web site using your favorite browser. (for example, "http://example.microsoft.com/favorites.asp")

Object Model

Think of this object as having an internal pointer to an item in a folder. What this pointer points to is undefined until the client calls "First" to set the pointer to the first item. "Next" is then used to move the pointer to the next item in the list. As each item is iterated, the URL and Name properties can be used to obtain the relevant information about each item. In typical Favorites folders, if the URL property is NULL, then the item is likely a folder itself which has items inside. For these items, the Group property can be used to obtain a brand new Favorites Reader object which is pre-initialized and pre-set to the first item in the new folder's list. In this way, a script can easily run through and obtain the name and URL of a whole series of Internet Shortcuts stored in a set of folders and all contained sub-folders.

Properties:Methods:Events:

None

Main Points of Discussion


Additional query words: Favorites Favread

Keywords: kbinfo kbdownload kbfile kbsample KB178380