@Echo off
cls

ARCID %1 ARJ RAR SQZ ZIP
if errorlevel 98 goto OK
if errorlevel 4  goto ZIP_COMMENT
if errorlevel 3  goto SQZ_COMMENT
if errorlevel 2  goto RAR_COMMENT
if errorlevel 1  goto ARJ_COMMENT

Echo ERROR: ARCID critical error! >> c:\arcid\arcid.log
exit

:ARJ_COMMENT
arj c -s1 -y -zc:\arcid\comment.txt %1
if not errorlevel 0 goto ERROR
goto OK

:RAR_COMMENT
rar c -tk -y -std -zc:\arcid\comment.txt %1
if not errorlevel 0 goto ERROR
goto OK

:SQZ_COMMENT
sqz c %1 c:\arcid\comment.txt
if not errorlevel 0 goto ERROR
goto OK

:ZIP_COMMENT
pkzip -k -z < c:\arcid\comment.txt %1
if not errorlevel 0 goto ERROR
goto OK

:OK
exit

:ERROR
Echo ERROR: Unable to comment archive... >> c:\arcid\arcid.log
exit
