@echo off & setlocal enableextensions & echo.

if "%1" equ "/?" (
   echo finish.bat copies general files to Confor output folders,
   echo clears archive attributes in those folders, deletes temporary files,
   echo and converts file names to lower case.
   exit /b 0
   )

set w=www
set i=info
call chkdir_ %w% || goto abort
call chkdir_ %i% || goto abort

set copfil_=0
call copfiq_ style.css %w%
call copfiq_ deltlogo.gif %w%
call copfiq_ deltlogl.gif %w%
call copfiq_ usdalogo.gif %w%
if %copfil_% neq 0 goto abort

attrib -a %w%\*.* > nul

goto skipwwwc
set w=wwwc
call chkdir_ %w% || goto abort

set copfil_=0
call copfiq_ style.css %w%
call copfiq_ deltlogo.gif %w%
call copfiq_ deltlogl.gif %w%
call copfiq_ usdalogo.gif %w%
if %copfil_% neq 0 goto abort

attrib -a %w%\*.* > nul
:skipwwwc
attrib -a %i%\*.* > nul

if exist *.bak del *.bak > nul
if exist *.lst del *.lst > nul
if exist *.tmp del *.tmp > nul
if exist *.wbk del *.wbk > nul
if exist temp.* del temp.* > nul
if exist temp_files\ rd /s/q temp_files
call lcase

goto end

:abort
exit /b 1

:end
exit /b 0
