@echo off :: MKINDEX.BAT - creates an index.htm file indexing htm/html :: files in current directory. To use copy this batch file to :: the directory containing html files and double-click. If :: running from dos prompt enter full path of batch including :: the .bat part so that it can find itself. The html output :: quotes the file names to be compatible with long file names, :: if not desired remove quotes from "%%f" and add quote to :: the end of the href= data line, and to beginning of next line. :: Written by WTN 9/25/05 if .%1==.Sub goto %2 if not exist index.htm goto doit echo index.htm already exists goto end :doit echo Creating index.htm... :: for dragging bat to dir and double-clicking it set batfile=%0 :: edit above if otherwise find "<% %head>" < %batfile% > index.tmp lfnfor on for %%f in (*.htm) do call %batfile% Sub process "%%f" lfnfor off find "<% %/ul>" < %batfile% >> index.tmp rename index.tmp index.htm set batfile= cls goto end :process find "<% %li>" < %batfile% >> index.tmp echo %3% %>> index.tmp find "><% %nulltag>" < %batfile% >> index.tmp echo %3% %>> index.tmp find "% %a>" < %batfile% >> index.tmp goto end :: this part of the file contains data, not executed