@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
IF NOT EXIST BAKLOG.LOG GOTO NOLOG
SET COBDIR=.
IF EXIST BACKUP.FLG DEL BACKUP.FLG
ECHO RESTORE>RESTORE.FLG
CD DATAFILS
..\RWCDEL USLCKF.0?
CD ..
LOADWIN
IF ERRORLEVEL=1 GOTO ERROR
RUN -f UTIL\URESTR
IF ERRORLEVEL 9 GOTO END
CLRWIND
TYPE UTIL\FIXDR1.MSG
PAUSE
TYPE UTIL\FIXDR2.MSG
PAUSE
ECHO X>DATAFILS\X.IDX
ECHO X>DATAFILS\X.DAT
DEL DATAFILS\*.IDX
DEL DATAFILS\*.DAT
RESCMD %1
IF ERRORLEVEL 4 GOTO SYSERR
IF ERRORLEVEL 3 GOTO CTLBRK
IF ERRORLEVEL 1 GOTO OTHERR
IF EXIST DATAFILS\*.IDX GOTO TESTDAT
GOTO SYSERR
:TESTDAT
IF EXIST DATAFILS\*.DAT GOTO VERIFY
:SYSERR
TYPE UTIL\FRSERR.MSG
GOTO END
:CTLBRK
TYPE UTIL\FRCTLC.MSG
GOTO END
:OTHERR
TYPE UTIL\FROERR.MSG
GOTO END
:VERIFY
ECHO Please wait ...
IF NOT EXIST DATAFILS\CHKFIL.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\CHKFIL.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\DEDCOD.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\DEDCOD.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\EMPFAU.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\EMPFAU.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\EMPSAU.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\EMPSAU.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\EMPFIL.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\EMPFIL.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\FSWORK.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\FSWORK.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\KHISFL.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\KHISFL.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\LAYOUT.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\LAYOUT.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\MANDIS.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\MANDIS.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\MANTRX.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\MANTRX.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\QTDHIS.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\QTDHIS.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\RPTNO.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\TAXCOD.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\TAXCOD.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\TIMDIS.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\TIMDIS.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\TIMTRX.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\TIMTRX.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UCHART.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UCHART.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UCHKBK.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UCHKBK.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UCKADJ.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UCKADJ.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UCOMPF.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UCRTRX.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UCRTRX.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UCVACT.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UCVACT.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UCVFIL.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UCVFIL.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UDBCHK.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UDBCHK.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UDBTRX.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UDBTRX.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UGJTRX.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UGJTRX.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UIINVF.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UIINVF.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UIITMF.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UIITMF.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UILTRX.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UILTRX.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UIPTXF.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UIPTXF.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UKCTLF.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UKDLYF.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UKDLYF.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UKEDCF.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UKHISF.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UKHISF.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UKKWDF.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UKKWDF.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UKUSRF.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\UKUSRF.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\UPRDFI.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\USCTLF.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\USDIST.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\USDIST.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\USLTRX.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\USLTRX.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\XFRFIL.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\XFRFIL.IDX GOTO SYSERR
IF NOT EXIST DATAFILS\YTDHIS.DAT GOTO SYSERR
IF NOT EXIST DATAFILS\YTDHIS.IDX GOTO SYSERR
:NORMEND
TYPE UTIL\RESEND.MSG
:END
CLRWIND
GOTO FINISH
:ERROR
CLRWIND
Echo The maximum number of users are currently running PSP+.
Echo Please try later.
GOTO FINISH
:NOLOG
Echo
Echo
Echo
Echo Could not find the file BAKLOG.LOG on your hard disk.
Echo This file is created by the procedure used in PSPBU.
Echo You cannot restore files with PSPRE until you have
Echo backed up files with PSPBU.  Please refer to your
Echo documentation.
:FINISH
SET COBDIR=
