# Place all MyE2B.cfg and wallpaper files in \_ISO\docs\mythemes and all rename .cfg files (amd any message GFXBoot file if more than one)
# Edit each \_ISO\docs\mythemes\xx.cfg file so background or GFX has correct path
# e.g. set MYWBMPGZ=/_ISO/docs/Templates/StripedFlat_pwd_is_fred/stripedflat.bmp.gz  OR set GFX=docs/mythemes/message  (note: no /_ISO/ for GFX path)
# Copy \_ISO\docs\mythemes\$Default E2B Menu.cfg to \_ISO\MyE2B.cfg (MyE2B.cfg must be >1KB and larger than largest xxx.cfg file)
# \_ISO\MyE2B.cfg file must be contiguous due to bug in grub4dos!

title Change Theme\n Choose a new E2B Theme
if not exist /_ISO/MyE2B.cfg echo ERROR: Please create a large \_ISO\MyE2B.cfg file && pause && configfile (md)0xa000+0x50
set CHOSEN=
errorcheck on
debug normal
graphicsmode 3
clear
echo Pick a Theme...
call /%grub%/PickaFile.g4b /_ISO/docs/mythemes .cfg
if "%CHOSEN%"=="" set DONEMENU= && configfile ()/%grub%/menu.lst
echo
echo Overwriting \_ISO\MyE2B.cfg file with \_ISO\docs\mythemes\%CHOSEN%...
# fill (rd) with 0's , 0x82d0 is rd-base mem address, Fn24 is memset - fill memory  <addr> <string> <size>
map (md)0x300+200 (rd) > nul ;; read 0x82d0 > nul ;; call Fn.24  %@retval% 0x20  102400 > nul  
dd if=(rd)+1 of=()/_ISO/MYE2B.cfg > nul
if exist ()/_ISO/docs/mythemes/%CHOSEN% dd if=()/_ISO/docs/mythemes/%CHOSEN% of=()/_ISO/MyE2B.cfg > nul
if exist ()/_ISO/docs/mythemes/%CHOSEN% chainloader /grldr
boot