Have you ever needed to create an HTML file that lists all the files and folders in a specific Windows directory? You may not need to do this very often, but it can come in handy from time to time.
For example, if you want to quickly create a list of all files and folders inside the Window directory and send it to someone in an easy-to-view format. Earlier I wrote about how you can use the command line or third-party applications to print a list of all files and folders in the Windows directory, however, these options only output to text, Word, or Excel.
DirHTML
DirHTML is a great program that pretty much does the same: generates a recursive list of files and folders, but outputs it as an HTML table with links! Thus, you can click any file to open it in a web browser or any other default application for that file type. This can be very handy for web developers working on a website locally.
Below is how the HTML directory listing for the download folder on my computer is displayed. You will notice that the result is a bit simple and old-school-like. This is because the program is outdated and therefore the web page it generates looks rather old. If you want more interesting output for the directory listing, check out the second Snap2HTML program I mention below.
At the top are anchors, which are links to all folders within the directory you specified. This will list all the files in the root folder and in each root folder along with their main file attributes. You can click any file to open it.
After downloading the program, just run the dirhtml.exe file, and you will get this configuration window:
The program is highly customizable, but you can also just select a folder and click the Create button if you don’t want to do anything else. You can filter by file extension (file specification) or file names.
In the Miscellaneous section, you can specify the file attributes you want to include in the HTML output and whether you want to use full paths in links. This is useful if you want to be able to transfer files / folders to another computer. You can copy the folder to another computer in the same path, i.e. C: My Documents Test, and still be able to click the files in the HTML list to open them.
In the Sorting section, you can choose to sort files by file name, size, date, and extension.
You can also configure the program to create a directory listing recursively or not. You can choose whether you want to combine all links into one HTML file or create an HTML file for each individual folder.
All in all, it is a useful program for quickly creating HTML web pages for any branch of a folder in Windows.
Snap2HTML
The second program, Snap2HTML, doesn’t have that many options, but it looks better. Here is the HTML output for the same download directory on my computer:
The program has a very simple interface and only a couple of options. To run the program, simply double-click the Snap2HTMLexe file. Like DirHTML, this program does not require installation.
First you select the root folder where you want to start the directory listing. There are two options for including hidden or system files, if you like. You can change the title of the HTML page and select the Include check box in the Link Files section if you want each file to be a clickable link.
You can test the “Open in Browser when Ready” button and then click “Create Snapshot” to create a list of HTML directories. You will be prompted to save the HTML file first and then it will open in your default web browser.
So, you have two programs that do their job. Each has its own pros and cons, so feel free to choose the one that best suits your needs. If you have any questions, please leave a comment. Enjoy!
–