write --offset=200 (hd-1,0)/BAT/_ENV.BAT set PEISO=%PEISO%\r\n
cat --locate=/ --replace=\\ (hd-1,0)/BAT/_ENV.BAT
set burgcd=
if exist (224)/0PE/0PENB.LZMA set burgcd=1 && find --set-root %PEISO% && map %PEISO% (0xff) && map --hook && set burgcd= ! echo -n
if exist burgcd map --floppies=1 && map (fd0,0)%PEISO% (0xff) && map --hook && echo %PEISO% is in (fd0,0) && set burgcd= ! if exist burgcd pause --wait=5 %PEISO% not found.
if exist ()%PEISO% && map --status=0xff > nul || set ready=1 && goto 3
goto 7
#3
title
echo Loading %@root%%PEISO%...
read 0x60064 && checkrange 0x21 read 0x82A0 && set mapmem=1
if "%@root%"=="(cd)" set mapmem=1
if not exist mapmem echo Direct map %PEISO% && map %PEISO% (0xff) || set mapmem=1 && echo Warnning: Fail to direct map %PEISO%, try to map with --mem.
if exist mapmem echo Map %PEISO% with --mem && map --mem %PEISO% (0xff) || pause Error: Fail to map --mem %PEISO% (0xff). && reboot
map --hook
if not exist ready rootnoverify (0xff) && goto 2
goto 7
#4
title
if exist (bd)/0PE/0PENB.LZMA rootnoverify (bd) && goto 2
if exist (bd)%PEISO% && rootnoverify (bd) && goto 1
if exist (bd)/0PE/0PE.ISO set PEISO=/0PE/0PE.ISO && rootnoverify (bd) && goto 1
if exist /0PE/0PENB.LZMA goto 2
if exist %PEISO% goto 1
if exist /0PE/0PE.ISO set PEISO=/0PE/0PE.ISO && goto 1
if exist (hd0)/0PE/0PENB.LZMA rootnoverify (hd0) && goto 2