@echo off cls REM Handy little utility to draft a table of contents using REM the names of files in the current directory REM Save it on your search path - type "path" in a command window to see where your command processor searches for commands and save it in one of those places REM Use "open command window here" to run it anywhere http://www.winhelponline.com/articles/109/1/How-to-add-Open-Command-Window-Here-context-menu-option-on-file-system-folders-in-Windows-Vista.html REM Then just run mktoc REM It will create a file named toc.txt that you can edit to create an annotated index of the files in the current directory REM re-run it any time and it will add any new files to toc.txt but not disturb the ones you already have indexed REM written by http://www.los-gatos.ca.us/davidbu/davidbu.html REM please keep the address above in the file, and copy this progrem freely REM see set/? and cmd/v:on and of course look this up in google because its not documented SETLOCAL ENABLEDELAYEDEXPANSION REM precede special characters with a caret set P=^+ set S=---------- REM Mysteries of DOS variables: http://www.chebucto.ns.ca/~ak621/DOS/DOS-Var.html IF EXIST toc.txt GOTO adddocs REM otherwise, create it echo Table of contents for: > toc.txt cd >> toc.txt echo %S% >> toc.txt goto alldocs :adddocs REM for each file in the current directory read the toc file and append anything that is new REM no match yet set INTOC=NO FOR %%F IN (*.*) DO ( REM ignore certain files REM save filename set THISFILE= set THISFILE=%%F REM reset set INTOC=NO REM do we have a match FOR /F "tokens=1,2* delims=+" %%I in (toc.txt) do if /I !THISFILE!^ ==%%I ( REM echo Matched: !THISFILE! = %%I set INTOC=YES ) REM process anything new REM set INTOC if /I !INTOC! == NO ( REM @echo Yes, New: %%F if !THISFILE! == toc.txt ( REM skip it REM echo Skipping: !THISFILE! ) else ( if !THISFILE! == %S% ( REM skip it echo Skipping: !THISFILE! ) else ( @echo !THISFILE! + >> toc.txt @echo Adding: !THISFILE! set ADDED_FILE=Y ) ) ) else ( REM @echo Not New: !THISFILE! ) rem next parens is end of file loop ) rem having processed the above, the next command is skipped goto done :alldocs FOR %%F IN (*.*) DO ( if %%F == toc.txt ( REM skip it REM echo Skipped: %%F ) else ( echo %%F %P% >> toc.txt ) ) set ADDED_FILE=Y :done rem take a look type toc.txt REM next line for debugging REM del toc.txt REM need the underscores in case the variable is not set if _%ADDED_FILE% == _Y ( notepad toc.txt ) pause Press Enter when you are finished editing... exit :end