ECHO OFF
SET DR=%1
CLS
ECHO JOCH.BAT is John Orlay's Cataloger of hard-drives Please read JOCX.DOC
ECHO ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
ECHO          (It can also be used to catalog a floppy)
REM  ------------------------------------------------------------------------
:SYNTAX
REM  Now checking syntax
IF NOT %1=="" GOTO DRIVE
ECHO  You forgot to state the drive-parameter !  You must read JOCX.DOC !  
ECHO  The correct syntax at the DOS prompt is       JOCH drive:
ECHO              example  for   floppy drive       JOCH A:
ECHO              example  for a fixed  drive       JOCH C:
GOTO END
REM  ------------------------------------------------------------------------
:DRIVE
ECHO  You specified drive %DR% as the one to be cataloged
ECHO.
ECHO  If %DR% is a floppy-drive then insert the floppy to be cataloged and
ECHO.
PAUSE
REM  ------------------------------------------------------------------------
:VOLUME
ECHO    Now checking whether the disk in drive %DR% has an internal label.
ECHO             IT IS ABSOLUTELY ESSENTIAL TO HAVE SUCH A LABEL
ECHO IF IT DOES NOT EXIST OR IF WRONG, YOU WILL GET AN OPPORTUNITY TO MAKE ONE 
ECHO.
DIR %DR% | FIND "Volume"
ECHO  PLEASE READ THE ABOVE LINE AND ACT AS FOLLOWS :
ECHO If %DR% has an internal label then press key 0 and then the ENTER/RETURN key
ECHO If %DR% has no internal label then press key 1 and then the ENTER/RETURN key
ECHO If you want a different label then press key 1 and then the ENTER/RETURN key
ANSWER
IF %ANSWER%==0 GOTO RAM
IF %ANSWER%==1 GOTO LABEL
ECHO You made an error.  Your choice "%ANSWER%" is illegal !
GOTO VOLUME
REM --------------------------------------------------------------------------
:LABEL
CLS
ECHO This program requires an internal label on the diskette in drive %DR
ECHO                       and will enable you to make a label, or change it.
ECHO                       There must be no "write-protect-sticker" on the disk
ECHO                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PAUSE
LABEL %DR%
REM --------------------------------------------------------------------------
:RAM
ECHO Now making RAMdrive
SETRAM D 360
COPY *.* D:
CD\
D:
REM  -------------------------------------------------------------------------
:TREE
ECHO Now making TR.DAT
REM               Looking at disk in the nominated drive
REM               Creates (in current directory) TR.DAT which will consist of :
REM                   Line  1         Volume Label of disk
REM                   Line  2         d:     (= nominated drive)
REM                   Lines 3 - end   Pathnames of all directories on %DR%
TREE %DR% > RAWTREE
FIND "FOR VOLUME" RAWTREE > TR1
CHANGE TR1 "DIRECTORY PATH LISTING FOR VOLUME " "" > NUL
ECHO Path: %DR%>> TR1
FIND "Pa" RAWTREE >> TR1 
FIND /V "RAWTREE" TR1 > TR.DAT
CHANGE TR.DAT "---------- TR1" "" > NUL
CHANGE TR.DAT 13,10,13,10 13,10   > NUL
CHANGE TR.DAT "Path: " ""         > NUL
CHANGE TR.DAT 13,10,13,10 ""      > NUL
DEL RAWTREE
DEL TR1
ECHO TR.DAT file created
REM -------------------------------------------------------------------------
REM  Now making CH.BAT
GWBASIC M-CHBAT
ECHO CH.BAT made
REM -------------------------------------------------------------------------
ECHO Now executing CH.BAT which makes CRCLOG.DAT and FILELOG.DAT
ECHO                            then executes M-FLDATH.BAT,  which - in turn -
ECHO                                 then filters FILELOG.DAT to FL.DAT
ECHO                                 then executes DC.BAS to make DC.DAT
ECHO                                 then echoes DC.DAT on the screen
ECHO                                 then copies DC.DAT to C:\JOC
ECHO                                 then returns to C:\JOC
ECHO                                 then deletes RAMdrive D:
ECHO.
ECHO Be patient, CRC32 calculations take about 3 minutes per Mb at  4.77 MHz
ECHO ~~~~~~~~~~                       or about 1 minute  per Mb at 16    MHz
CH
REM -------------------------------------------------------------------------
:END
