REM --- IMPORTANT!!!IMPORTANT!!!IMPORTANT!!!IMPORTANT!!!IMPORTANT!!!
REM --- Please COPY ZIPTEMPD.BAT as ZIPDCDB.BAT before editing ZIPDCDB.BAT !!!
REM --- This Backup file can be used with DC305 and DCCON programs 
REM --- The icon for backing up should be using ZIPDCDB.BAT
REM --- Please confirm the correct PATH for your DC305 or DCCON program folder
REM --- Please confirm the correct EDBPATH for your EXTERNAL BACKUP DRIVES 
REM --- Please confirm the correct HC for your herdcode if not using C:\HERDS folder 
REM --- Please set the correct path for DC305 or DCCON and EXTERNAL BACKUP DRIVES
REM --- If the MULTINTX or MULTI9X will be used, setup the correct goto area
REM --- This batch file defaults to MULTINTx backups
REM -----------------------------------------------------------------------

    SET PATH=C:\DC305;%PATH%
    SET EBDPATH=E:
    SET HC=herdcode

REM ----------------------------------------------------------------------

 CLS
 ECHO OFF
 ECHO.
 ECHO   IMPORTANT!!! You must EXIT your DC305 or DCCON program first !!!
 ECHO   Place EXTERNAL BACKUP DRIVE in the COMPUTER DRIVE LETTER %EBDPATH% NOW !!!
 ECHO   Remember to reformat your EXTERNAL BACKUP DRIVES by running FORMAT %EBDPATH%  
 ECHO   every 3 months, to do this go to the START,--> RUN section of Windows !!!
 ECHO   If you add another herd, please confirm with VAS that it backs up !
 ECHO.
 PAUSE

REM goto MULTI9x
goto MULTINTx

:SINGLE
REM ----S-I-N-G-L-E--C-O-W-F-I-L-E-S--O-N-L-Y-!-!-!-------B-E-G-I-N-------*
REM --- This section is for single herds only when multiherd is not used
REM --- VASHRD-HERD COWFILE SECTION of this batch file is USED!!!!
REM ----------------------------------------------------------------------

    MOVE %HC%.ZP2 %HC%.ZP3
    MOVE %HC%.ZP1 %HC%.ZP2
    MOVE %HC%.ZIP %HC%.ZP1

    PKZIP -ES -= %HC% cow*.dat cow*.arc sem*.dat dcsetup.* *.def *.par
    
    COPY C:\DC305\%HC%.ZIP %EBDPATH%\ /V

    MD %EBDPATH%\DC305
    MD %EBDPATH%\DCPICS
REM MD %EBDPATH%\DrugWatch

    XCOPY C:\DC305\*.* %EBDPATH%\DC305\*.* /Y /D
    XCOPY C:\DCPICS\*.* %EBDPATH%\DCPICS\*.* /Y /D
REM XCOPY C:\DrugWatch\*.* %EBDPATH%\DrugWatch\*.* /Y /D /S
 
REM --- Add the "/S" to the XCOPY command above if the DMDAT directory
REM --- needs backing up. See the next line below for proper setup !!!
REM --- Ex: XCOPY C:\DC305\*.* %EBDPATH%\DC305\*.* /Y /S /D

goto DONE

REM -----S-I-N-G-L-E--C-O-W-F-I-L-E--O-N-L-Y-!-!-!------E-N-D-I-N-G-------*




:MULTINTX
REM ----M-U-L-T-I-N-T-X--C-O-W-F-I-L-E-S--O-N-L-Y-!-!-!---B-E-G-I-N-------*
REM --- For NT kernal systems
REM -----------------------------------------------------------------------

REM For Windows NTx users

COPY C:\HERDS\*.ZIP C:\HERDS\*.ZP1 
DEL  C:\HERDS\*.ZIP

DIR C:\HERDS /B /AD > HERDS.LST
for /F %%i in (HERDS.LST) do PKZIP -= -X*.BA? C:\HERDS\%%~ni C:\HERDS\%%~ni\*.*
REM for /F %%i in (HERDS.LST) do PKZIP -R -P -= -X*.BA? C:\HERDS\%%~ni C:\HERDS\%%~ni\*.*

     MD %EBDPATH%\HERDS
     MD %EBDPATH%\DC305
     MD %EBDPATH%\DCPICS
REM  MD %EBDPATH%\DrugWatch
  
     
     XCOPY C:\HERDS\*.ZIP %EBDPATH%\*.ZIP /Y /D
     XCOPY C:\HERDS\*.* %EBDPATH%\HERDS\*.* /S /Y /D
     XCOPY C:\DC305\*.* %EBDPATH%\DC305\*.* /Y /D
     XCOPY C:\DCPICS\*.* %EBDPATH%\DCPICS\*.* /Y /D
REM  XCOPY C:\DrugWatch\*.* %EBDPATH%\DrugWatch\*.* /Y /D /S

REM --- Add the "/S" to the XCOPY command above if the DMDAT directory
REM --- needs backing up. See the next line below for proper setup !!!
REM --- Ex: XCOPY C:\DC305\*.* %EBDPATH%\DC305\*.* /Y /S /D

goto DONE

REM ---M-U-L-T-I-N-T-X--C-O-W-F-I-L-E-S--O-N-L-Y-!-!-!--E-N-D-I-N-G------*


:MULTI9X
REM ----M-U-L-T-I-9-X--C-O-W-F-I-L-E-S--O-N-L-Y-!-!-!---B-E-G-I-N-------*
REM --- For 9x kernal systems
REM -----------------------------------------------------------------------
   
REM For Windows 9x users

COPY C:\HERDS\*.ZIP C:\HERDS\*.ZP1 
DEL  C:\HERDS\*.ZIP

DIR C:\HERDS /B /AD > HERDS.LST
NEAPPLY HERDS.LST "PKZIP -= -XCOWFILE*.BA? C:\HERDS\%% C:\HERDS\%%\*.*"
REM NEAPPLY HERDS.LST "PKZIP -R -P -= -XCOWFILE*.BA? C:\HERDS\%% C:\HERDS\%%\*.*"

     MD %EBDPATH%\HERDS
     MD %EBDPATH%\DC305
     MD %EBDPATH%\DCPICS
REM  MD %EBDPATH%\DrugWatch
  
     
     XCOPY C:\HERDS\*.ZIP %EBDPATH%\*.ZIP /Y /D
     XCOPY C:\HERDS\*.* %EBDPATH%\HERDS\*.* /S /Y /D
     XCOPY C:\DC305\*.* %EBDPATH%\DC305\*.* /Y /D
     XCOPY C:\DCPICS\*.* %EBDPATH%\DCPICS\*.* /Y /D
REM  XCOPY C:\DrugWatch\*.* %EBDPATH%\DrugWatch\*.* /Y /D /S

REM --- Add the "/S" to the XCOPY command above if the DMDAT directory
REM --- needs backing up. See the next line below for proper setup !!!
REM --- Ex: XCOPY C:\DC305\*.* %EBDPATH%\DC305\*.* /Y /S /D

goto DONE

REM ---M-U-L-T-I-9-X--C-O-W-F-I-L-E-S--O-N-L-Y-!-!-!--E-N-D-I-N-G------*



:DONE
REM ------------------------------------------------------------------*****

 CLS
 PKUNZIP -T %EBDPATH%\*.zip > ZIPTEST.LOG
 IF ERRORLEVEL 1 GOTO PROBLEM
 PKUNZIP -T %EBDPATH%\*.zip 


 ECHO.
 ECHO  This is a Test of the Zipped Herd Files on the Zip Drive
 ECHO  Press ENTER key to continue !!!
 ECHO.
 PAUSE

 CLS
 PKUNZIP -V %EBDPATH%\*.ZIP > ZIPVIEW.LOG
 PKUNZIP -V %EBDPATH%\*.ZIP 
 ECHO.
 ECHO  Check the Dates for Cowfile1.DAT and other important files
 ECHO  Remember to reformat your EXTERNAL BACKUP DRIVES every 3 months !!!
 ECHO.
 PAUSE
 GOTO NOPROBLEM

:PROBLEM
 PKUNZIP -T %EBDPATH%\*.zip > ZIPERROR.LOG
 COPY ZIPERROR.LOG PRN

:NOPROBLEM
 ECHO    VERIFY YOUR BACKUPS AND LOGS
  

