@echo off
setlocal
if not exist webshots*.exe goto Syntax
if not "%1"=="" goto Syntax
ver | find "Windows NT" >nul
if errorlevel 1 goto Syntax
echo ^<HTML^>>%~n0.html
echo ^<HEAD^>>>%~n0.html
echo ^<TITLE^>Webshots collections^</TITLE^>>>%~n0.html
echo ^</HEAD^>>>%~n0.html
echo ^<BODY^>>>%~n0.html
echo ^<H1^>Webshots Desktop^</H1^>>>%~n0.html
echo ^<P^>Install the ^<A HREF="webcat.exe"^>Webshot Desktop software^</A^> first!^</P^>>>%~n0.html
echo ^<P^>To install software using your browser you may>>%~n0.html
echo need to click through a lot of safety warnings.^</P^>>>%~n0.html
echo ^<H1^>Webshots Collections^</H1^>>>%~n0.html
for %%a in (webshots*.exe) do call :SingleFile %%a
echo ^</BODY^>>>%~n0.html
echo ^</HTML^>>>%~n0.html
start "HTML" "%~n0.html"
goto End
:SingleFile
for /f "tokens=1* delims==" %%A in ('unzip -p %1 collectn.ini ^| find "Name="') do (
echo ^<A HREF="%1"^>%%B^</A^>^<BR^>>>%~n0.html
echo %1 %%B
)
goto:EOF
:Syntax
echo.
echo Catalog.cmd, Version 1.00 for Windows NT
echo Catalog Webshots collections (webshots*.exe)
echo (Webshots can be found at http://www.webshots.com)
echo Written by Rob van der Woude
echo http://www.robvanderwoude.com
echo.
echo Usage: %~n0
echo.
echo Must be started in a directory containing self-extracting collections.
echo Needs write access to the current directory to create an HTML file.
echo Needs UNZIP.EXE, which must be available somewhere in the PATH.
:End
endlocal