@echo off
REM /////////////////////////////////////////////
REM This is a sample ConvertLZH.Cmd for AdeptXBBS
REM It will unarchive a LZH file and convert it
REM to a ZIP file.
REM /////////////////////////////////////////////

REM //////////////////////////////////////////
REM Command line parms are as follows:
REM %1 = Complete filename to work on
REM %2 = Line number
REM %3 = Com port file handle
REM %4 = Just filename (no path, no extension)
REM %5 = Just extension
REM %6 = Just Drive:Path
REM //////////////////////////////////////////

REM //////////////////////////////////////
REM Change to drive where temporary files
REM will be stored
REM //////////////////////////////////////
C:

REM ////////////////////////////////////
REM Change to dir where temporary files
REM will be stored
REM ////////////////////////////////////
CD\Adept\System\Line%2

REM /////////////////////
REM Make a convert subdir
REM /////////////////////
MD Convert
CD Convert

REM ////////////////////////////////////////
REM Extract files into temp directory
REM ////////////////////////////////////////
LH X %1

REM ////////////////////////////////////
REM ZIP up the files
REM NOTE: Same dir, different extension
REM ////////////////////////////////////
ZIP -m %6%4

IF ERRORLEVEL 1 GOTO Cleanup

DEL %1

ECHO %4.ZIP >%4.NewName


:Cleanup
REM /////////////
REM Back to Adept
REM /////////////
C:
CD\Adept
DEL /Y C:\Adept\System\Line%2\Convert
RD C:\Adept\System\Line%2\Convert