Change the order of the menu entries

Menu entries are sorted alphabetically by file and folder name in this order (not case sensitive):
Valid characters:
 ! # $ % & ' ( ) + , - .  0-9 ;  @    [  (space character)  ] ^ _ `  A-Z  { | } ~
Do not use = (equals sign) in any filenames! This will cause the E2B menu builder to abort!
The space character will be expanded to \(space) by grub4dos and so has a precedence above [ but below ].
Note that files named 9_fred.iso and 10_fred.iso will be listed alphabetically in the menu as:
Use leading 0's so that the files are sorted correctly: 
I recommend that you use a 'sort override prefix' to change the menu order...

Sort override prefix (_*_)

Using E2B v1.A9 or later versions, you can change the menu order if the file or folder name starts with (underscore) as the first character followed by any number of characters and then another _.

E2B will ignore the leading _ character and then sort the files according to the 2nd and all following characters. If a second _ exists in the filename, only the characters after the second _ will be displayed, otherwise all characters after the first _ will be displayed.

In this way, you can change the sort order of any item in the menu.

The files will be listed in the menu without  the _*_ prefix.

For instance:

\_ISO\MAINMENU\_$$$a_Ubuntu 64-bit.iso
\_ISO\MAINMENU\_aba_DLC 2017.imgPTN

will be look like this in the Main Menu:

Ubuntu 64-bit
Set default menu entry and timeout 
(this entry is due to the standard E2B $$SetDefaultMenu.mnu file)
DLC 2017
(standard E2B menu  and sub-menu entries)  
(these entries are due to the standard E2B ZZSubMenuAll.mnu file)

Note that _$$$a_ will be listed first (even before E2B's $$$SetDefaultMenu.mnu file because $$$a comes before $$$S). 

The _ xxxx _ sort prefix also works with folders and .mnu files as well as payload files.

You may like to use _000_ to _999_ as prefixes (or _000_ to _999_).

You can add a .txt file to change the entry text and the help text for that entry, but the filename must be identical, e.g.

\_ISO\MAINMENU\_$$$a_Ubuntu 64-bit.iso
\_ISO\MAINMENU\_$$$a_Ubuntu 64-bit.txt


WARNING: Do not use four  $ symbols,  ! # " or space at the start of the filename (e.g. do not use _$$$$ or _! or $$$$ or !) because this may stop the special $$$$CONFIG folder from working correctly. 

I suggest using:

  •  _$$$000_ to _$$$999_    for early menu items
  • _000_ to _999_               for mid-menu items
  • _ZZZZ000_ to _ZZZZ999_ for the menu items that follow the E2B MAIN menu items
Tip: You can remove the F7/F8/F9/F10 menu entries by using NOxxxx variables in the MyE2B.cfg file (e.g. set NOF7HD=1). You can then add your own F7-F10 .mnu files or use Global hotkeys for F7-F10 if you wish. Use 'set NODEFMENU=1' to suppress the 'set default menu and timeout' menu entry. You can copy \_ISO\docs\Sample mnu files\E2B Menus\$$SetDefaultMenuandTimeout.mnu to \_ISO\MAINMENU and rename it if you want to add your own default menu entry.
If the filename starts with _ but there is no second _ in the filename (e.g. _Ubuntu64.iso) then the file will be sorted as if the first character was U and it will be displayed in the menu as Ubuntu64.
You can also use sort override prefixes on payload files in the \_ISO\WINDOWS\xxxxx sub-folders (except the XP folder) (E2B v1.B0+).
If you also use a .txt file, you must use the same filename for both files, e.g.:
  • _100_Ubuntu v14.1 (x64).iso
  • _100_Ubuntu v14.1 (x64).txt
Tip: As the enumerated payload files are listed on the screen, press the SPACEBAR once - the list will pause and you can see how E2B has alphanumerically sorted each payload file and folder.

More on alphabetical sorting

The order that ISO, other payload files and .mnu files are listed in, is determined by E2B alphabetically sorting the payload and .mnu files and folders (not case-sensitive, but note that 10a.iso will be listed before 9a.iso because 1 comes before 9 as an ASCII value - instead use 09a.iso and 10a.iso).

For example: all you need to do is rename your payload and .mnu files, eg. aaz_fred.iso, aca_doris.iso, aea_debian.iso, etc..

Sort order prefixes, e.g. _234_Ubuntu 13.2 64-bit.isodef, can be used and the menu entry will be seen as Ubuntu 13.2 64-bit but it will be ordered as if it had the filename of 234_Ubuntu 13.2 64-bit.isodef (E2B v1.A9+).

You can also add a .txt file which has the same file name as the payload file, to present a nicer menu entry and also define your own menu entry help text at the bottom of the menu area when the file is selected in the menu (e.g. aaz_fred.iso + aaz_fred.txt).

The .mnu files will be listed depending on the name of the .mnu file itself (not the payload file or title which is used inside the .mnu file). If you have 'Ubuntu.mnu' for instance, it will therefore be listed after the 'PassPass.iso' (say). To change the order, simply rename ubuntu.mnu to say M_ubuntu.mnu.

Note that folders will also be searched alphabetically. If you have:


the MENU entry order will be:


Note that the menu entry for PassPass will be listed after the menu entry for Ubuntu because Ubuntu.mnu alphabetically precedes \Utility. If you want PassPass to be listed before Ubuntu, rename Ubuntu.mnu to ZUbuntu.mnu.

Tip: If you press the SPACE key during file enumeration, E2B will pause at the end of enumeration, to allow you to see the order it has enumerated the files and folders in (v1.72+).

 Now you can easily see the order that the folders and files are enumerated in.



Now change the name of ZZSubMenuDos.mnu and wattOS-R8-Microwatt.iso...


If you want the $wattOS-R8-Microwatt.iso menu entry to be listed as 'Microswatt OS R8' then create a .txt file:

title Microswatt OS R8\n WattOS Micro R8

or simply rename the ISO as _000_Microswatt OS R8.isodef (E2B v1.A9+).

Re-order the default E2B menu entries

The E2B default menu entries such as 'Set default menu entry and timeout',  'Help [F1]', 'Boot to first HDD [F7]', etc. must first be disabled by using the NOxxxxx variables in your MyE2B.cfg file (e.g. set NOF1=1).

Then you can create new .mnu files for each of the menu entries. Some example .mnu files can be found in the \_ISO\docs\Sample Mnu Files\E2B Menus folder, e.g. $$F01_Help_Menu_F1.mnu.

The .mnu files are alphabetically sorted, so simply change the name of the .mnu file to change the menu order.

A blank menu line can be inserted by adding a blank .mnu file - e.g. A_BlankMenuEntry.mnu.

Each menu folder must contain a copy of each .mnu file if you want it in that menu or sub-menu.

You may find it useful to define Global Hotkeys instead of adding menu entries into each menu.

Another alternative is to use a sort override prefix character sequence with your files or folders (see top of page - E2B v1.A9+).

See here for more details.

AUTO folder

.mnu files are ignored if you put them in the AUTO folder (so they won't work!). 

Also, all payload files in and under the AUTO folder are enumerated and added to the DIRECT BOOT menu. So you can have multiple folders under \_ISO\AUTO,

If you have a lot of ISO files, and you don't want to change the filenames but you want to change their order in the menu, then put them in sub-folders under \_ISO\AUTO with a .txt file for each one, e.g.:


Note: These will be listed in the DIRECT BOOT sub-Menu - using folders like this for payload files, only works for the special AUTO folder. For the other menu folders (ANTIVIRUS, BACKUP, etc.) you will need to use a .mnu file or place the payload+.txt file in the main folder.

If you later want to add an entry in between these two, create a \_ISO\AUTO\A1\ folder. The entries will be listed in alphabetical order of both the files and folders.

Since you cannot add .mnu files to the AUTO folder, use Global Hotkeys instead if you want to disable the E2B generated menu entries. For example, you could add a global hotkey for F8 to return to the Main menu.

Use of .mnu files

If you do not want to change the ISO filenames but want to change their order in the Main menu (or one of the other sub-menus), then you will need to use .mnu files for each one and place them all in a sub-folder - e.g. \_ISO\MAINMENU\MNU.

The .mnu files should be of the following format:

e.g. \_ISO\MAINMENU\MNU\AAA_Ubuntu64.mnu contents:

title Ubuntu ISO\n Help text
/%grub%/qrun.g4b $HOME$/Ubuntu-x64.iso

You can also change the name of the sub-menu folder or create new  3rd level folders. See my blog here for details.

Sub-Menus listed in the Main Menu

The sub-menus entries (for ANTIVIRUS, BACKUP, etc.) are defined in the \_ISO\MAINMENU\ZZSubMenuAll.mnu file.

As this begins with 'ZZ' the sub-menu entries will be listed at the end of all other menu items in the Main menu. If you want the sub-menu entries listed first in the Main menu, rename it to $$ZZSubMenuAll.mnu.

Note: If you ever update your E2B USB drive with a later version of E2B, you will need to delete the new \_ISO\MAINMENU\ZZSubMenuAll.mnu file again.

Alternatively, start the name of all your payload and .mnu files with 'ZZZ' so that they are listed below the sub-menus or use a sort prefix override of _ZZZ_ (see top of page).