@Echo off
Cls
Echo Please ensure that no other users are currently using
Echo the Point of Sale System.  If other users are on the
Echo system, press CTRL/C now, and re-run this batch later.
Pause
SET COBDIR=.
IF EXIST RESTORE.FLG DEL RESTORE.FLG
ECHO BACKUP>BACKUP.FLG
CD DATAFILS
..\RWCDEL USLCKF.0?
CD ..
LOADWIN
RUN -f UTIL\UBKLOG
IF ERRORLEVEL 9 GOTO END
CLRWIND
TYPE UTIL\FIXDBU.MSG
:BACKIDX
BAKCMD IDX %1
IF ERRORLEVEL 4 GOTO SYSERR
IF ERRORLEVEL 3 GOTO CTLBRK
IF ERRORLEVEL 1 GOTO OTHERR
IF EXIST A:*.IDX GOTO BACKDAT
IF EXIST A:CONTROL.* GOTO BACKDAT
GOTO SYSERR
:BACKDAT
ECHO Do not remove the diskette currently in drive A: at this time!
ECHO The message below states "Insert last backup diskette in drive A:".
ECHO This is referring to the diskette already in drive A!
BAKCMD DAT %1
IF ERRORLEVEL 4 GOTO SYSERR
IF ERRORLEVEL 3 GOTO CTLBRK
IF ERRORLEVEL 1 GOTO OTHERR
IF EXIST A:*.DAT GOTO NORMEND
IF EXIST A:CONTROL.* GOTO NORMEND
GOTO SYSERR
:NORMEND
CD DATAFILS
..\RWCDEL USLCKF.0?
CD ..
LOADWIN
RUN -f UTIL\BAKEND
GOTO END
:SYSERR
TYPE UTIL\SYSERR.MSG
GOTO END
:CTLBRK
TYPE UTIL\FBCTLC.MSG
GOTO END
:OTHERR
TYPE UTIL\FBOERR.MSG
GOTO END
:END
CLRWIND
SET COBDIR=
