If you want to pass parameters from a grub2 environment to grub4dos, you can use grub.exe.
For instance you boot to Ventoy but then want to run a simple Linux ISO using grub4dos.
e.g. legacy grub2 -> loads legacy grub4dos and executes grub4dos commands...
menuentry "Boot mycd.iso" { set opts='map /test/mycd.iso (0xff); map --hook; chainloader (0xff);' linux /boot/grub/grub4dos.exe --config-file=${opts} }
however, grub4efi (grub4dos for efi) has no equivalent mechanism.
We can save variables in grub2\grubfm\Ventoy using the save_env command however, e.g.
save_env -f (hd0,1)/ventoy/grubenv vt_param
This means we can then reboot or load a different bootloader such as grub4efi and parse the grubenv file when menu.lst is loaded.
# get the variable vt_param into the grub4dos variable P (and grub4dos variable vt_param) /grubenv.g4b vt_param "(bd)/ventoy/grubenv"
We also need to convert any file path to be grub4dos compatible.
See here for more details.
The batch files can be found in Easy2Boot2.20aBeta.zip on the E2B Alternate Downloads page.
I attach current version here too,