I strongly recommend that you add your own grub4dos menus as .mnu files into E2B, rather than trying to use some of the E2B features and batch files in your own menu system without running from the E2B menu system.
The USB drive should not contain more than 2 primary partitions.
Partition 4 must be empty.
Partition 3 is used by some functions (e.g. if you use linux+persistence) and so this also should be unused.
For best 'bootability', I recommend that the USB drive contains twoPrimary partitions (even if the 2nd one is very small).
Also, ensure grub4dos is installed to both the MBR, and the PBR of the first partition.
Ensure you are using the same version of grub4dos that E2B uses - copy the \grldr file in the E2B download to the root of your grub4dos-bootable USB drive and overwrite any older version.
You must preserve the \_ISO folder structure used by E2B.
If you already have a syslinux or grub4dos multiboot USB drive, you can add E2B to your USB drive as follows:
1. Download, extract and copy ALL the E2B files to your existing multiboot USB drive (including the files in the root).
If you already have a \menu.lst file then do not overwrite it with the E2B menu.lst.
Ensure the E2B folder \_ISO is in the root of the USB drive (do not move it to a different folder).
2a. If you have a grub4dos menu.lst file, add in a menu entry to run E2B as follows:
title Run Easy2Boot
2b. If don't already have a \menu.lst file and have a syslinux boot pen, add this to your syslinux menu (the E2B \menu.lst file will be required)
MENU LABEL Easy2Boot
Using E2B features in your own grub4dos menus (not recommended)
If you just want to use the same method of autorunning any payload file but don't want the E2B menu system (notrecommended), you can use QRUN.g4b in your menus, e.g.
title Run xxxx.iso
title Run Hirens
You can also force QRUN to run an iso as if it had a different extension, e.g. this will run the iso as if it had the .isowinvh file extension
Note: If the filename or path contains spaces, you must precede the space with a \ character, e.g. /_ISO/MAINMENU/Windows\ PE.iso
Note: The %grub% variable must be set by you to point to the folder that contains QRUN.g4b and all the other files and folders under grub, so at the top of your menu.lst put something like:
cat /%grub%/%LANG%/STRINGS.txt > (md)0x880+0x80
# next line assumes the USB drive will be hd0 - it usually is when booting from USB.
if not "%E2BDEV%"=="hd0" pause ERROR: E2BDEV = %E2BDEV% !!!
#initialise memory areas so they are not confused by grub4dos seeing them as compressed files!
echo fffffffffffffff > (md)0x800+1
echo fffffffffffffff > (md)0x220+1
echo fffffffffffffff > (md)0x3000+1
echo fffffffffffffff > (md)0x6000+1
echo fffffffffffffff > (md)0xA000+1
# set keyboard scan codes (uses USA if not set) - optional
# load font file for non-US language fonts - e.g. Ü.
You will need to load a language file into memory (3rd line). If you don't do this you will get 'Missing $$STRxxxx' messages.
Note that you should check E2BDEV is hd0.
Many different files and folders are used by QRUN.g4b - ALL the files and folders under the grub folder must be present.
You MUST preserve the folder structure (i.e. \_ISO\e2b\grub and \_ISO\e2b\firadisk and \_ISO for CONTIG.ISO and MyE2B.cfg) and set the grub variable to _ISO/e2b/grub. You can use a different folder for %grub% as long as you only boot simple linux ISOs (not Windows or WinPE) - ALL the E2B files and folders under the grub folder must be present. I do not recommend this though and cannot support it or be held responsible for any damage to the USB drive or to system disks if you don't use the original E2B folder structure!
WARNING: I recommend you do not use .imgPTN files in non-E2B menus! You can potentially destroy partitions on the system hard disk if anything goes wrong or if E2BDEV is set to the wrong device.
To run WinPE/Windows Install ISOs, you should first clear the \AutoUnattend.xml and \Unattend.xml files using the code below.
Otherwise, if you run any WinPE payload using .iso or .vhd or .wim, then it may use the \AutoUnattend.xml file from the previous boot!
# don't abort if error
# fill (rd) with 0's , 0x82d0 is rd-base mem address, Fn24 is memset - fill memory
iftitle [ls (bd)/iso/autoboot/ > (md)0x9F00+1 && checkrange 1:-1 read 0x13E0000 > nul] Load AutoBoot Menu\n Run any ISO
(bd)/%grub%/QAUTO.g4b .automenu /iso/autoboot
dd if=%LBACKMENU% of=(md)0xA000+0xA0 > nul
iftitle [ls (bd)/iso/LINUX/ > (md)0x9F00+1 && checkrange 1:-1 read 0x13E0000 > nul] Load Linux Menu\n Load Linux Menu
dd if=%LBACKMENU% of=(md)0xA000+0xA0 > nul
Transfer to a different E2B drive (DANGER!)
If you boot grub4dos from a different drive or partition, you can transfer to the E2B drive using this menu entry:
find --set-root /_ISO/e2b/grub/menu.lst
Note that this is not recommended because the boot drive will not be the E2B drive. Check the E2BDEV variable carefully! Be aware that Easy2Boot menus may destroy partition 4 of a drive (drive is defined by %E2BDEV%). Also, some .mnu files may expect to be running from hd0 and be hard-coded for hd0. It also assumes that hd0 is a USB drive for certain functions - it may accidentally erase/modify disk 0 of your system! So check carefully any menu you use!
Note: This may not work for exFAT E2B drives because grub4dos may just load your other \menu.lst file first!