@Echo Off :: WebTab.btm Builds an index.htm from all the MOZART files in a directory. :: Started with what is now the routine ":DoIt", later fleshed out with bits :: from Mike Bessy's mkindex2.btm and its revision by J.B. Falconer. :: Michael Bednarek mb@tgm.com.au http://mbednarek.com/ - May 2002 :: Oct-2003: Refined "Recycle"; used description of subdirectory for TITLE, H1 :: Used backquotes (`) instead of symbolic escape (%=) :: Jan-2004: Added switch to Codepage 1252 - necessary under NT5.x :: Jan-2004: Added inclusion of counter HTML code :: Apr-2004: Utilised _codepage instead of %@WORD[-0,%@EXECSTR[CHCP]] *SetLocal *Unalias * ALIAS Recycle=`%@IF[%_CMDPROC EQ 4DOS,C:\More95\Recycle -f,*DEL /R /Q]` :: Obtain only the current directory name: Set sub=%@Word["\",-0,%@Full[.]] Pause %0: Building index.htm for %sub [Hit Enter] Iff Exist index.htm Then Pause Deleting index.htm to the Recycle Bin [Hit Enter] Recycle index.htm EndIff SET old_UC=%@OPTION[UnicodeOutput] OPTION //UnicodeOutput=No Echo >index.htm `
` :: SET descr=%@Descript[..\%sub] %+ This didn't work for umlauts :: Translation ASCII to ANSI through the Clipboard only works under NT5.x when Codepage=1252 :: But this only seems to work if UnicodeOutput=No - See above SET old_CHCP=%_codepage CHCP 1252>NUL ECHO %@Descript[..\%sub] > CLIP: SET descr=%@Clip[0] Echo>>index.htm ``[%s scores and %t files indexed on %_Date at %_Time +1000 Echo>>index.htm `by 4NT!]` REM Include Counter HTML code Copy /Q index.htm+..\counter.htm Echo>>index.htm `` Echo %s scores and %t files indexed on %_Date at %_Time OPTION //UnicodeOutput=%old_UC Quit :: Note that /TR and /TD are optional and not used here :DoIt Set fn=%@Name[%@LFN[%n]] :: Description (may contain redirection symbols) SetDos /X-56 /P%=$ /E%=^ /C%=& Set des=%@Replace[>,`%`=>,%@Replace[<,`%`=<,%@Descript[%fn.mz]]] SetDos /X+6 :: Translate ASCII to ANSI - only works under NT5.x when Codepage=1252 (see above) Echo>CLIP: %des SetDos /X-6 Set des=%@Replace[>,`%`=>,%@Replace[<,`%`=<,%@Clip[0]]] SetDos /X+6 EchoS>>index.htm `