Change menu entry order

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 for use in file names (in order):  ! # $ % & ' ( ) + , - .  0-9 ;  @  [  (space character) ] ^ _ `  A-Z  { | } ~ 

Do not use = (equals signs) in any  filenames! This will cause the E2B menu builder to abort! 

Do not use $ (dollar signs) in any payload  filenames if you also want to use agFM. 

The space character will be expanded to \(space) by grub4dos and so has the precedence of being above [ but below ]

Note that files named 9_fred.iso and 10_fred.iso will be listed alphabetically in the menu as:

10_fred.iso
9_fred.iso 

Use leading 0's so that the files are sorted correctly: 

010_fred.iso
009_fred.iso 

I recommend that you use a 'sort override prefix' to change the menu order - see next section... 

Sort override prefix ( _*_ or xxx_ )

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.

Recommended sort order prefix (letter+digit+digit+_)

Alternatively, if the fourth character is an underscore but the first character is NOT an underscore, then the menu will be sorted on the whole filename but the first four characters will not be displayed in the E2B menu (v2.09+). This scheme works well for E2B and agFM with first letter hotkey selection - e.g. d34_Ubuntu 64.iso - if you press 'd' in the agFM menu it will jump to the menu entry. You can use a to z prefixes and then two numbers for all entries. This is also compatible with Ventoy as it also arranges the files alphanumerically.

Use a three-character prefix + underscore - press 's' to jump to the entry beginning with a.
E2B does not show filename prefix - press 'c' to jump to entry 1.

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\#a0_Ubuntu 64-bit.iso
\_ISO\MAINMENU\aaz_Mint.iso
\_ISO\MAINMENU\aba_DLC 2017.imgPTN

will be look like this in the E2B Main Menu:

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

Note that _#a_ or #a0will be listed first (before E2B's $$$SetDefaultMenu.mnu file because # comes before $ alphabetically). 

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

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\a10_Ubuntu 64-bit.iso
\_ISO\MAINMENU\a10_Ubuntu 64-bit.txt

WARNING: Avoid using the ! symbol. If you use three !!! symbols  (e.g. _!!!xxx_abc.iso) this will stop the special !!CONFIG folder from working correctly.

I suggest using only for E2B:

  •  #00_ to #99_         for early menu items (and rename $$$$CONFIG to !!CONFIG if it exists and you have an old version of E2B) (or #00_ to #zz_)
  • a00_ to z99_           for mid-menu items (or a00_ to z99_)
  • ZZ0_ to ZZ9_ for the menu items that follow the E2B MAIN menu items (or zz0 - zzz)

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+). 

.txt files

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).

Files beginning with a number can interfere with the E2B number menu jump feature - I suggest you use the letter+2digit prefix, e.g.

u32_Ubuntu x64.iso - works in both E2B and agFM menu system if you press U as hotkey

a10_XUbuntu x64.iso - press X in E2B menu (as listed as XUbuntu x64) and press a in agFM menu (as listed as a10_XUbubtu x64.iso)

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 a10_ubuntu.mnu.

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

\_ISO\Mainmenu\Utility\PassPass.mnu
\_ISO\Mainmenu\Ubuntu.mnu

the MENU entry order will be:

Ubuntu
PassPass

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.