@Echo Off :: WebDB.btm Build delimited text file database for *-db.htm files :: Started with what is now the routine ":DoIt", later fleshed out with bits :: based on Mike Bessy's mkindex2.btm and its revision by J.B. Falconer and :: my own WebTab.btm which is also based on these. :: Michael Bednarek mb@mbednarek.com http://mbednarek.com/ - May 2002 :: Jan-2004: Added switch to Codepage 1252 - necessary under NT5.x :: Apr-2004: Utilised _codepage instead of %@WORD[-0,%@EXECSTR[CHCP]] *SetLocal *Unalias * :: Obtain only the current directory name: Set sub=%@Word["\",-0,%@Full[.]] Pause %0: Building index.txt for %sub [Hit Enter] Iff Exist index.txt Then Pause Deleting index.txt to the Recycle Bin [Hit Enter] Rem Recycle is an external program by Matt Ginzton, MaDdoG Software %@If[%_CMDPROC EQ TCMD32 .OR. %_CMDPROC EQ 4NT,Del /R,Recycle /f] index.txt EndIff :: But this only seems to work if UnicodeOutput=No SET old_UC=%@OPTION[UnicodeOutput] OPTION //UnicodeOutput=No Text >index.txt Title|FName|DtPubl:DATE DMY|ZIP-A|ZIP-N:INT|MZ-A|MZ-N:INT|TXT-A|TXT-N:INT|MID-A|MID-N:INT|PDF-A|PDF-N:INT EndText :: Translation ASCII to ANSI through the Clipboard only works under NT5.x when Codepage=1252 SET old_CHCP=%_codepage CHCP 1252>NUL :: Avoid piping. Problems with 4NT and TC32. Dir /b *.mz >%Temp\Files.tmp For %n In (@%Temp\Files.tmp) Gosub DoIt CHCP %old_CHCP >NUL OPTION //UnicodeOutput=%old_UC Quit :DoIt Set fn=%@Name[%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 Echo>CLIP: %des SetDos /X-6 Set des=%@Replace[>,`%`=>,%@Replace[<,`%`=<,%@Clip[0]]] SetDos /X+6 EchoS>>index.txt %des%=|%fn%=| :: Filedate EchoS>>index.txt %@Filedate[%fn.mz]%=| :: ZIP EchoS>>index.txt %sub/%fn.zip%=|%@Comma[%@FileSize[%fn.zip]]%=| :: MOZART EchoS>>index.txt %sub/%fn.mz%=|%@Comma[%@FileSize[%fn.mz]]%=| :: Text Iff Exist %fn.txt Then EchoS>>index.txt %sub/%fn.txt%=|%@Comma[%@FileSize[%fn.txt]]%=| Else EchoS>>index.txt none%=|none%=| EndIff :: MIDI EchoS>>index.txt %sub/%fn.mid%=|%@Comma[%@FileSize[%fn.mid]]%=| :: PDF Echo>>index.txt %sub/%fn.pdf%=|%@Comma[%@FileSize[%fn.pdf]] Return