@ECHO OFF
REM REDBL.BAT - Version 4.01.200
REM Copyright 1993-94, Stac Electronics

CLS
ECHO.
ECHO REDBL.BAT
ECHO.
echo This program will replace the DBLSPACE.BIN file located in the root
echo directory of drive %1  This should only be done if you suspect the
echo Stacker-aware DBLSPACE.BIN is missing, corrupt or accidentally replaced
echo with the DOS 6 equivalent DBLSPACE.BIN.
ECHO.

IF NOT "%1"=="" GOTO CHECK1
ECHO.
echo Please retype the command followed by the drive letter you wish to
echo copy DBLSPACE.BIN.  For example, REDBL C:
GOTO END

:CHECK1
SET SSRC=
IF EXIST %SSRC%STACLOAD.BIN IF EXIST %SSRC%STACKER.COM GOTO CHECK3
SET SSRC=\
IF EXIST %SSRC%STACLOAD.BIN IF EXIST %SSRC%STACKER.COM GOTO CHECK3
SET SSRC=\STACKER\
IF EXIST %SSRC%STACLOAD.BIN IF EXIST %SSRC%STACKER.COM GOTO CHECK3
SET SSRC=C:\STACKER\
IF EXIST %SSRC%STACLOAD.BIN IF EXIST %SSRC%STACKER.COM GOTO CHECK3

ECHO.
echo REDBL.BAT could not locate one of its driver files.  Please try running
echo REDBL %1 from the Stacker 4.0 disk #1.
ECHO.
GOTO END

:CHECK3
IF NOT EXIST %1\DBLSPACE.BIN GOTO CHECK6
SET ASRC=
IF EXIST %ASRC%SATTRIB.EXE GOTO CHECK4
SET ASRC=\
IF EXIST %ASRC%SATTRIB.EXE GOTO CHECK4
SET ASRC=\STACKER\
IF EXIST %ASRC%SATTRIB.EXE GOTO CHECK4
SET ASRC=C:\STACKER\
IF EXIST %ASRC%SATTRIB.EXE GOTO CHECK4
GOTO DEL-FAIL

:CHECK4
IF EXIST %ASRC%SATTRIB.EXE %ASRC%SATTRIB.EXE -A -R -S -H %1\DBLSPACE.BIN >NUL
 
GOTO DEL-FILE

:DEL-FILE
IF EXIST %1\DBLSPACE.BIN DEL %1\DBLSPACE.BIN

IF NOT EXIST %1\DBLSPACE.BIN GOTO CHECK6

:DEL-FAIL
ECHO.
echo REDBL.BAT was unable to delete the current DBLSPACE.BIN file located on
echo drive %1.  Check to see that SATTRIB.EXE is in C:\STACKER, or in the path
echo before trying this operation again.
ECHO.
GOTO END

:CHECK6
ECHO   WARNING: About to update DBLSPACE.BIN file...
ECHO.
PAUSE
COPY /B %SSRC%STACLOAD.BIN+%SSRC%STACKER.COM %1\DBLSPACE.BIN
ECHO.
IF EXIST %1\DBLSPACE.BIN GOTO OK

GOTO CHECK7

:CHECK7
ECHO   Error: REDBL.BAT was unable to update the DBLSPACE.BIN file.
ECHO.
echo   The specified drive could be full or damaged.
echo   Please check drive %1 and run REDBL %1 again.
ECHO.
GOTO END

:OK
ECHO.
echo The Stacker-aware DBLSPACE.BIN driver was successfully updated on drive %1.
echo Reboot your computer in order for the new driver to take effect.
ECHO.

:END
