@echo off
if %1'==' goto EOF
REM -- For Alternative USB Config --
REM -- DELETE "REM " from Next line
REM if exist bootcd\uharcd.exe set RAM=102400
IF "%RAM%==" goto s
echo Creating %RAM% Kb Ram Drive as %ramd%:
REM xmsdsk %RAM% %ramd%: /t /y
Tools\shsurdrv /D:%RAM%K:D512:$RAM-DRIVE,%ramd% %M98% /QQ
set ram=
goto cp
:s
echo Creating 100Mb Ram Drive as %ramd%:
REM xmsdsk 102400 %ramd%: /t /y >nul
Tools\shsurdrv /D:102400K:D512:$RAM-DRIVE,%ramd% /QQ
:cp
if exist %ramd%:\nul goto ramok
echo Failed to load SHSURDRV ram drive
echo Loading Standard RamDrive.sys with 32Mb...
Tools\devload Tools\ramDrive.sys 32767 512 512 /E >nul
Tools\findramd
IF ERRORLEVEL 255 GOTO RAMPROB
IF NOT ERRORLEVEL 3 GOTO RAMPROB
IF ERRORLEVEL  3 SET ramd=C
IF ERRORLEVEL  4 SET ramd=D
IF ERRORLEVEL  5 SET ramd=E
IF ERRORLEVEL  6 SET ramd=F
IF ERRORLEVEL  7 SET ramd=G
IF ERRORLEVEL  8 SET ramd=H
IF ERRORLEVEL  9 SET ramd=I
IF ERRORLEVEL 10 SET ramd=J
IF ERRORLEVEL 11 SET ramd=K
IF ERRORLEVEL 12 SET ramd=L
IF ERRORLEVEL 13 SET ramd=M
IF ERRORLEVEL 14 SET ramd=N
IF ERRORLEVEL 15 SET ramd=O
IF ERRORLEVEL 16 SET ramd=P
IF ERRORLEVEL 17 SET ramd=Q
IF ERRORLEVEL 18 SET ramd=R
if exist %ramd%:\nul echo RamDrive.sys Successfully Loaded as %ramd%:
if exist %ramd%:\nul goto ramok
echo error creating ramdrive
pause
goto stop
:RAMPROB
echo.
echo !! Failed To Create Ram Drive as %ramd%: !!
echo    this could be because of more than 2GB RAM
echo.

:ramok
for %%v in (command.com Tools\extract.exe Tools\mouse.com Tools\drivers.cab Tools\usb_aspi.cab) do copy %%v %ramd%:\ >nul
set comspec=%ramd%:\command.com
if exist bootcd\uharcd.exe Tools\BootDriv.exe>%ramd%:\z.bat
type tools\autoexec.dat>>%ramd%:\z.bat
type autoexec.bat>>%ramd%:\z.bat
REM -- For Alternative USB Config --
REM -- if you get "General failure reading drive"
REM -- DELETE "REM " from LINE 5 (if exist bootcd\pqpm.uha set RAM=102400) and
REM -- DELETE Next Line "GOTO NORMAL" (or add REM)
GOTO NORMAL
if not exist bootcd\uharcd.exe goto NORMAL
md %ramd%:\BootCD
md %ramd%:\BootCD\vdefs
copy bootcd\uharcd.* %ramd%:\BootCD
copy bootcd\*.uha %ramd%:\BootCD
copy bootcd\vdefs\*.* %ramd%:\BootCD\vdefs
:NORMAL
%ramd%:
z %1 %2
:stop
