About .mnu files
Writing .mnu fles
Tip: To make a simple .mnu file from a 'payload' file (e.g. an ISO), drag-and-drop the payload file onto the
"\_ISO\docs\E2B Utilities\E2B MNU Maker.cmd" file.
For those payload files which do not work correctly when simply placed in an E2B menu folder (even with a renamed file extension) or if they have special requirements, such as they need to use a persistent filesystem to store changes, you will need to use a special grub4dos menu file for them. For Easy2Boot these extra files have the .mnu file extension and they contain a grub4dos menu that has been specially written for a particular ISO or payload file.
Note: If a .mnu file is placed at level 2 (e.g. \_ISO\LINUX) and the .iso file is also placed in the same level 2 folder - there will be TWO menu entries in the E2B sub-menu - one for the .iso file and one for the .mnu file. To avoid this, place both files at the 3rd level or deeper (e.g. \_ISO\LINUX\MNU) and you will only see the .mnu menu entry.
For example, for a linux ISO that requires a .mnu file, you could add the payload file (e.g. ISO file) and it's matching .mnu file to the \_ISO\LINUX\Linux folder (note that the correct sub-folder may need to be created to match the one specified in the .mnu file, so you may need to make a new 'Linux' folder - also note that Linux is case sensitive so use the correct case for any linux parameters which are in the .mnu file). Some new .mnu files can be downloaded from the Easy2Boot Download page but most are in the \_ISO\docs\sample mnu files folder contained in the E2B download. Once added, the .mnu file entry will be listed in the sub-menu once it has been selected from the Main menu.
Note that a .mnu file will work in any standard menu folder (e.g. \_ISO\MAINMENU or \_ISO\DOS or \_ISO\ANTVIRUS) or any sub-folder of any name under these folders - the names of the 3rd level folders (e.g. MNU) have no special significance - any name can be used because E2B searches all sub-folders for all .mnu files.
.mnu files do not work in the \_ISO\AUTO folder (or below) and do not work in any \_ISO\WINDOWS folder or sub-folder.
Instructions on how to use each .mnu file are included as text comments inside each sample .mnu file - please read the instructions in each .mnu file. You may also need to edit the .mnu file if you are using a slightly different version of the ISO so that the ISO filenames are correct. If your language uses special non-ASCII characters, save the .mnu file in UTF-8 format.
Tip: If you want to have two menu entries to run the same linux ISO, e.g. one with and one without persistence, place both the .iso file and the .mnu file at the 2nd level (e.g. \_ISO\LINUX).
IMPORTANT: Use forward-slash / instead of \ for folder paths in a .mnu file - grub4dos is like linux and uses / instead of \.
Filenames with spaces
When a path or filename contains a space, you must precede each space character with \ (backslash) - example for "Ubuntu Boot CD 2014.iso":
/%grub%/QRUN.g4b $HOME$/Ubuntu\ Boot\ CD\ 2014.iso
I tend to avoid spaces in payload filenames when using .mnu file for this reason!
%MFOLDER%, $NAME$ and $HOME$ Keywords
When specifying a path in .mnu file, you can use the %MFOLDER% variable which will be set to the parent's menu folder (e.g. \_ISO\MAINMENU) or you can use $HOME$ which will be set to the .mnu path.
For example, the following are all equivalent if the .mnu file is located in the \_ISO\LINUX\Linux folder:
I recommend you use $HOME$ whenever possible.
If the file name contains spaces such as Ubuntu x86.iso, then precede each space with a \ character - e.g. $HOME$/Ubuntu\ x86.iso
$NAME$ is the filename (without extension) of the .mnu or .txt file that it is used in. The filename can contain spaces. (v1.67+)
e.g. You have two files with identical filenames (.mnu and .iso):
iftitle [if exist $HOME$/$NAME$.ISO] Ubuntu \n Boot from $NAME$.ISO
(more grub4dos lines here)...
You should name the payload file exactly the same as the .mnu file and so you do not need to modify the text inside the .mnu file. You can then copy or move both files to any standard menu folder or download a later version of the ISO and simply rename the .mnu file.
Note that because we use iftitle, if you delete the Ubuntu.iso file, then the menu entry will not appear in the menu. If you add Ubuntu.iso back again, then it will be listed in the menu again.
Tip: /%grub%/ is used as the path to the \_ISO\e2b\grub folder, which is where most grub4dos batch files and utilities are located.
Tip: if a .mnu menu entry is not automatically numbered by grub4dos and you cannot select it with the UP/DOWN cursor keys (but can select it using RIGHT/LEFT cursor keys), simply add 'boot' as the last line of the menu.
Using iftitle in .mnu files
The expression inside the square brackets [expr] must equate to TRUE for the menu to be displayed.
Any variable inside the square brackets must already exist.
All menu entries with iftitle statements are evaluated first by grub4dos, after that, each menu entry is listed in the menu.
You can use iftitle in .mnu and .txt files.
For instance, suppose we only want to display an Ubuntu 64-bit ISO if the system's CPU is a 64-bit CPU
We could place the following line in our \_ISO\MyE2B.cfg file (which is executed at an early stage):
checkrange 2,3 is64bit && set BIT64=1
This will set the variable BIT64 to the value of 1 if the CPU is a 64-bit CPU.
Now we can use the BIT64 variable in a .mnu or .txt file:
iftitle [if exist BIT64] Ubuntu x64 \n
To use a variable it must be enlosed in % signs, so we could instead write:
iftitle [if "%BIT64%"=="1"] Ubuntu x64 \n
Note that we enclose the BIT64 variable in double-quotes "..." - this is because if BIT64 was not defined, if %BIT64%==1 would resolve to if ==1 which is an invalid expression and cause an error. So by using "%BIT64%" the expression resolves to if ""=="1" which has correct syntax.
The \_ISO\Sample_MyE2B.cfg file contains examples of other variables you can set, e.g. MYMEMMB for the size of memory in MB, or MYDISKGB for the size of the USB boot disk in GB, GB4 if there is more than 4GB of memory, etc.
If you see these $$STR Keywords used in an E2B .mnu file or .txt file, they will be replaced by the equivalent text from a STRINGS.txt language file (e.g. using text inside the \_ISO\e2b\grub\ENG\STRINGS.txt file if English is the selected language).
If you are creating your own .mnu or .txt files, just substitute ordinary text in-place of the Keywords
iftitle [if "%GFX%"==""] $$STRm005
can be changed to:
iftitle [if "%GFX%"==""] This is the menu entry\n This is the help text below the menu box
Note: Hotkeys do not work in a GFX Boot menu, so often there will be two almost identical menu entries, one with a hotkey and one without a hotkey in the 'iftitle' line.. The [if "%GFX%"==""] portion means 'if a GFX boot menu is not being used' - so the menu entry will not be displayed if the user has configured E2B to load a GFX Boot 'message' menu file instead of an ordinary wallpaper bitmap file. You can omit this portion and just use title This is a menu entry\n Help text if you don't want to check for GFX Boot menus.
Note that because hotkeys don't work in GFX Boot menus, don't define a hotkey in your .mnu or .txt files if you want to use GFX Boot menus.
Add a non-persistent menu entry to a persistent .mnu file
title Boot directly from linux myiso.iso \n HERE IS MY HELP TEXT
If you want to be able to delete the large .ISO file, but leave the .mnu file on the USB drive in case you want to restore it later, you will need to use iftitle so that the menu entry is only seen when the .iso file is present:
iftitle [if exist $HOME$/myiso.iso] Boot directly from myiso.iso \n HERE IS MY HELP TEXT
QRUN.g4b is the grub4dos batch file which is responsible for booting a payload file according to it's file extension.
If you want a menu entry to run a payload which is in a different folder, then specify the complete path, e.g.
.mnu file = \_ISO\MAINMENU\MyIso.mnu so we get an entry in the Main Menu:
iftitle [if exist/_ISO/WIN/myiso.iso] Boot directly from myiso.iso \n Run an ISO in a different folder
Override the file extension
Normally, the file extension of a file determines how E2B will run it. There may be some circumstances where you want to have the same .ISO file (for example) but run it in two different ways. For instance, if your USB drive is a Zalman or IODD drive and you need to keep the .iso file extension on all files so that the drive can find them.
To do this create a .mnu file with the following format
title HERE IS MY TITLE\n HERE IS MY HELP TEXT
/%grub%/QRUN.g4b FORCE.isoPE $HOME$/myiso.iso
This will run MYISO.ISO as if it had a file extension of .ISOPE.
Here is another example of how to run the same .imgPTN file in two different ways - (place the .mnu file and the .imgPTN file in a MNU 3rd-level sub-folder)
Auto-run .imgPTN files
Normally, when you select a .imgPTN file (of any type), E2B will display some information about the file and then prompt the user to ask if it is OK to switch partitions. This can be suppressed for .imgPTN files by adding "AUTO" to the file extension, e.g. .imgPTNAUTO, however we can also use the AUTOCSM variable in a .mnu file as follows:
If you don't want the clonezilla .imgPTNLBA23 file to be listed in the menu as well as the .mnu file entry, place both the image file and the .mnu in a subfolder (e.g. move it from \_ISO\BACKUP to \_ISO\BACKUP\MNU or \_ISO\BACKUP\ANYNAME).
Tip: If you add 'set AUTOCSM=1' to your \_ISO\MyE2B.cfg file, then the .imgPTN user prompt text will be suppressed for all .imgPTN-family files.