MSIEtoHTML--Java Program to convert Microsoft Internet Shortcuts

This program converts Microsoft Internet Explorer shortcuts into HTML format. I know many Java users and programmers are using Netscape, however, you may be interested in the classes I've written:

Note that you'll need a copy of the Java Development Kit to run this application. Alternatively, you can run the program with Microsoft Internet Explorer using the JVIEW command, though this is now not recommended due to Sun's recent court action against Microsoft.
The main class that walks the directory tree finding shortcut files (*.URL) and generating appropriate headings for each directory. If you need an algorithm to walk through a directory tree, you're free to use this one.
This class provides methods and a constructor for generating HTML files. It's not fully capable, In particular, it doesn't yet convert content into ISO entities (&lt, &gt, &amp", etc.), nor does it fully support HTML2, let alone HTML4. However, it's very easily expanded and (IMHO, of course!) does a great job of insulating the calling class from the gritty details.
Reads an Internet Shortcut file and parses it to get the URL.
As I'm interested in compilers (I wrote a tiny Pascal compiler for my college final project 15 years ago), I decided to get fancy and write a state-machine parser. It's more complicated than it needs to be and is arguably NOTOO-centric, but it works.
All three source files and compiled classes.

Documentation for MSIEtoHTML is included in, but essentially, it's a command line app with the following parameters:

java MSIEtoHTML <favdir> <htmlfile> ["Your Title"]

or with Microsoft's JVM [no longer supported]:

jview MSIEtoHTML <favdir> <htmlfile> ["Your Title"]
<favdir>   is the location of the Internet Shortcutdirectory,
               usually C:\windows\favorites
<htmlfile> is the name of the HTML file you want created.  Note
               that any existing file with this name will be over-
               written.  This is a Java "feature", i.e. bug.            
"Your Title"   The title you want for the HTML file.  This is 
               optional; if not specified, the title is 
               "Bookmarks of <htmlfile>"

Permission to use the source

Please feel free to use and modify my source code for your purposes. If you're going to use any of my classes in your code, please attribute me. And if you've any questions, please drop me a line at

Wish list and things to do:

  1. Expand WriteHTMLFile to at least do ISO entities and support HTML2.0 (and XHTML 1.0, now that my website is written to that.)
  2. Rewrite it into a GUI app with the AWT or Swing (not very likely, I hate GUI programming)
  3. Write a class that would let the program connect with the net to do link checking. It could even note invalid links in the HTML file for review later.

Dave Moisan's Computer Page
Dave Moisan's Home Page

David Moisan
Copyright © 1997, 2003, David Moisan
Last updated on April 25th, 2003