Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Import Favorites from IE

Import Favorites from IE

Import Favorites from IE

I would like to import favorites from IE to a *.tps file.

I would normally use a *.csv file for this purpose but IE does not allow me to export my favorites to a *.csv file, only to a HTML file.

Is there any way I can import my favorites from IE to a *.tps file?


RE: Import Favorites from IE


All Favorites are stored in the C:\Documents and Settings\<WindowsUserName>\Favorites folder on XP and C:\Users\<WindowsUserName>\Favorites on Win7. Just use DIRECTORY() and scan through the folder and all it's sub-folders and open the Internet Shortcut files as a ASCII file and get your information. An example shortcut file is shown below ::




RE: Import Favorites from IE

Thank you ShankarJ

The bit I do not understand is after using DIRECTORY() to locate the favorites folder how do I go about scanning the folder and its sub folders and return the shortcuts as a ACSII file?


RE: Import Favorites from IE



DirQueue         QUEUE,PRE(DQ)
FullPath           STRING(512)

FileQueue        QUEUE(File:queue),PRE(FQ)

URLQueue         QUEUE,PRE(URL)
Name               STRING(256)
Link               STRING(1024)
LOC:Path         STRING(512)
LOC:Counter      LONG
LOC:Inner        LONG
LOC:ASCFileName  STRING(512)

Record             RECORD
Data                 STRING(512)
                 . .

  DQ:FullPath = 'C:\Documents and Settings\<WindowsUserName>\Favorites\'

  LOC:Counter = 0
     LOC:Counter += 1
     GET(DirQueue, LOC:Counter)
     LOC:Path = DQ:FullPath
     DIRECTORY(FileQueue, CLIP(LOC:Path) & '*.*', ff_:Normal+ff_:DIRECTORY)
     LOC:Inner = 0
        LOC:Inner += 1
        GET(FileQueue, LOC:Inner)
        IF BAND(FQ:Attrib,ff_:DIRECTORY) AND FQ:ShortName <> '..' AND FQ:ShortName <> '.'
           DQ:FullPath = CLIP(LOC:Path) & CLIP(FQ:Name) & '\'
           LOC:ASCFileName = CLIP(LOC:Path) & CLIP(FQ:Name)
           IF ERRORCODE()
                 IF ERRORCODE() THEN BREAK.
                 IF SUB(ASC:Data,1,4) = 'URL='
                    URL:Name = FQ:FileName
                    URL:Link = SUB(ASC:Data,5,LEN(CLIP(ASC:Data))-4)

Make sure you add the ASCII driver to your project's Database drivers. You can scan through the URLQueue and copy it to a TPS file.


RE: Import Favorites from IE

Thanks for all your trouble ShankarJ, much appreciated, I will give it a go.

Just as a point of interest though I have found that a simple batch file like the one below seems to work OK (did not fully test) but would I be right in saying that its not a good practice to run a batch file(s) from an app?

cd \
cd MyFavoritesFolder
copy *.url url.txt

Kind Regards.

RE: Import Favorites from IE


Are you sure that "copy *.url url.txt" will copy all the URLs into one file? You could use "for %f in (*.url) do type %f >> url.txt" instead.

Running a batch file is not an issue but IMHO a liability as the application depends on something outside it.


RE: Import Favorites from IE

Hi ShankarJ

Yes, sorry my mistake, the batch file example I posted will not copy all the files. Having thought about it a bit more I would not use a batch file as I am not comfortable in doing so but I thought it was still worth a mention as an easy way for anyone wanting to export their own favorites to text.

Thanks again for all your help.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close