!BAT
# IMPORTANT: This file MUST begin with !BAT
#             --- DO NOT EDIT THIS FILE! ---

#   --- set the version number ---
# 1.00 2013-06-18 First Release
# 1.01 2013-07-05 Few bug fixes
# 1.02 1.01 + DPMS2 Update Pack v 1.02 (2013-07-06)
# 1.03 2013-07-11 Requires new grldr, improved sort, bug fixes, auto-selection for XP ISO install
# 1.04 2013-07-15 DPMS2 minor bugfixes, small changes to XP install
# 1.05 2013-08-03 set redir=> nul   will cause file enumeration messages to be suppressed
# 1.06 2013-08-05 all files now alphabetically sorted (i.e. not payload then .mnu, but all sorted in same pass)
# 1.07 2013-08-24 .isope file extension supported - if WinPE2/3/4 iso then when wpeinit runs, the iso will be loaded as a virtual CD/DVD, ISOASK variable supported
#                 Full alphabetical sorting, .isoPE extension, WinPE (.isope) can mount .ISO after booting and can define drive letter for the ISO and post cmd batch file.
# 1.08 2013-09-04 bitdefender mnu file added to docs folder, Win8.1 temporary Product keys added, master pwd option in MyE2B.cfg
# 1.09 2013-09-11 .vhdmem supported, small tweaks to some sample .mnu files
# 1.10 2013-09-15 DEFMENU=0 (suppresses 0 set default menu entry) BUGFIX!, NOUNIFONT=1 (does not load unifont font file)
# 1.10a 2013-09-25 Small changes in sample .mnus, etc. no code changes.
# 1.11 2013-09-26 Bugfix in menu.lst - was not clearing \autounattend.xml!
# 1.12 2013-10-15 Added grub4dos 0.4.6a as fallback if BIOS boots USB as fd0, spaces.txt now deleted, global hotkey feature, warning if ISO file not contiguous, .iso boot fix for HP systems, extra startup msg suppression
# 1.13 2013-10-18 Small bugfixes to 1.12
# 1.14 2013-10-21 Various tweaks added for single menu support and hiding startup text, beep, etc. see Sample_MyE2B.cfg for details
# 1.15 2013-10-22 AUTO (DIRECT) did not blow down through subfolder, 2PTN fix, menu item number in top right of menu now hidden
# 1.16 2013-10-29 Same as 1.15e - also released with dpms2. Extra demo theme Template added - BeepShowBackgroundDemo.
# 1.17 2013-11-02 grub4dos find command removed and CheckAccess is not done if CHECKBIOS variable is cleared in MyE2B.cfg. New .isoDOS file extension supported
# 1.18 2013-11-30 New grub4dos with font fix, extra fonts, unifont now displayed for Latin characters (0-ff), FONT definable, BIOSFONT option, grldr 0.4.6a used
# 1.19 2013-12-09 Bugfix - black horizontal line across 1024x768 background now fixed, clonezilla sample .mnu added to docs folder, new ENG folder for easier language conversion, bug where some main menu items not listed after F8 fixed.
# 1.20 2013-12-28 If XP ISO has '64' in the name then it will not use DPMS2.
# 1.21 2014-01-04 DPMS2 bugfix if two mass storage drivers are picked.
# 1.22 2014-01-05 Bugfix for QAUTO (Direct\AUTO folder and PTN2_Menu.mnu should now work!), (1.22B) NoF7HD bugfix
# 1.23 2014-01-20 Changes to allow booting from the WINHELPER flash drive but run Windows Install ISOs from a USB HDD. Other ISOs using partnew will not work though.
# 1.24 2014-01-22 Changes to LOADISO code to prevent E2B on the Helper USB flash drive from running.
# 1.25 2014-01-29 $HOME$ supported in .mnu files to represent folder that .mnu file is in. e.g. $HOME$ will be replaced by /_ISO/MAINMENU/MNU
# 1.26 2014-02-05 BUG IN WIN8 INSTALLS! Few extra .mnu sample files added. Can now have individual XP Install entries in Main menu.
# 1.27 2014-02-06 Fix bug in RunWin8.g4b - not writing to \Autounattend.xml on Helper drive!
# 1.28 2014-02-12 Add BIOS string detect sample .mnu and support files.
# 1.29 2014-02-18 Added more sample .mnu files. New grldr for u/lcase FAT32, Make TXT/MNU File scripts
# 1.30 2014-03-03 Convert $HOME$ in .txt files, support E2B on a logical partition of boot device, grub4dos 0.4.6 with USB driver option
# 1.31 2014-03-24 Restored Winhelper.usb search code as find --set-root in menu.lst was causing long delays on some systems
# 1.32 2014-04-01 XP install improvements - new chkpci, win2k,2k3 support, .imgPTN support for UEFI and MBR partition images
# 1.33 2014-04-14 .imgPTN menu not displayed properly when first switch to CSM menu. autorun.inf added for E2B icon in Explorer
# 1.34 2014-04-20 \_ISO\WIN folder supported as subMenu entry. Text changes from rmprepusb.com to easy2boot.com
# 1.35 2014-04-25 Added code to only ask for master password on boot, add variable to suppress search for WINHELPER.USB if no USB HELPER drive used
# 1.36 2014-04-27 .imgPTNA added
# 1.37 2014-05-01 .imgPTNAlba and .imgPTNAlba23 added
# 1.38 2014-05-09 HEADPOS added for changing heading position, some more demo themes added
# 1.39 2014-05-13 Bugfix - if FAT32 and directory had . in folder name then error'd and stopped
# 1.40 2014-05-14 .imgPTN now supports auxilliary partition image (no file extension for auxilliary file)
# 1.41 2014-06-03 memtest86 added (with UEFI booting to memtest86 if FAT32) -QAUTO bugfix - did not enumerate sub-folders.
# 1.42 2014-06-10 CONTIG.ISO supported for non-contiguous ISOs
# 1.42a 2014-06-17 bugfix for forceiso mnu

# 1.50 2014-06-25 Better Language support STRINGS.TXT, many files removed from ENG folder, $$STRxxxx variable used for strings
# 1.51 2014-06-29 .imgPTN == .imgPTNLBAa  (for non-active .imgPTN use .imgPTNna), minor text colour changes for some messages
# 1.51a 2014-07-04 Bugfix for Step2 XP install (can't find asms files) - now loads ISO into memory!
# 1.52 2014-07-09 LANG remembered after F8, BETA German and Spanish languages added
# 1.53 2014-07-11 WinVBlock driver for XP 32-bit DPMS changed to 'reboot12's driver. Language files changed/added, Make E2B script bugfix (wrong grubinst used), QRUN.g4b changed so any version of grub4dos will work with .imgptn files
# 1.54 2014-07-25 force extension in QRUN.g4b fixed, new .IMArw and .IMAnomem extensions
# 1.55 2014-08-20 various tweaks - see www.easy2boot.com for complete list!
# 1.56 2014-08-25 suppress press any key on install win isos, allow for ( & characters in windows iso filenames, new grub4dos grldr, FASTLOAD changed. 1.56a new grub4dos (1.56 version had XP bug), WIN10
# 1.57 2014-10-21 New grub4dos version (1.57a - fix for different splashimage in main menu)
# 1.58 2014-10-31 Halloween special! v1.57a + new grldr
# 1.60 2014-11-06 Remove old heading strings - no longer supported, ZZSubMenuxxx.mnu files combined into ZZSubMenuAll.mnu, extra variables in Sample_MyE2B.cfg.
# 1.61            Can specify XML file for Win ISOs in mnu file, German STRINGS.txt improved. isoboot added to boot non-contiguous linux ISOs, Italian added
# 1.62 2015-02-18 .dmg, .haiku, dmgHFS file extensions added, menupwd support added, parted magic added to isoboot.g4b with LIVE peristence option. CRC32 and isoboot SHIFT\CTRL key feature added. PIN added. File extensions .xxx64 and xxx32 supported.

set VER=v1.62

#             --- DO NOT EDIT THIS FILE! ---
#

set EXTOFF=1

#check BIOS for access > 137GB bug
set CHECKBIOS=1
set GFX=

# ------------ HEADING AND FOOTER TEXT COLOUR ---------

# sets the colour of the HEADING and FOOTER TEXT text 
# HCOLOUR=ABCD specifies the text colour  [BLINK|BRIGHT|BACKGROUND|FOREGROUND]
# A=0/1 1 = BLINK text (does not work under VM)
# B=0/1 1 = BRIGHT colour for foreground text
# C=0-7 = BACKGROUND colour - transparent if graphics mode so has no effect!
# D=0-7 = FOREGROUND menu text colour
# Colours parameters are: 0=black/grey 1=dark blue, 2=green, 3=aqua, 4=dark red, 5=pink, 6=yellow/brown, 7=grey/white.
# e.g. 0133 is non-blinking bright aqua text (on a dark aqua background if not in graphics mode)

set HCOLOUR=0133
set FCOLOUR=0133

set B64=32-bit
checkrange 2,3 is64bit && set B64=64-bit

# set B64 text
set /a M=*0x8298 & 0xffffffff>>10+1 > nul && set /a M1=*0x82c0>>10+1 > nul
set /a M=%M% + %M1% > nul
set B64=[%M%MB %B64%]
set M=
set M1=

#                  --------- MAIN MENU HEADING -----
#
# Headings must be between two \x20 and between 58 and 78 characters long - but not more than 78 or will get line wrap-over if in 640x480 mode
# If not enough spaces at the end, you will see spurious characters at the top of the display!
#                          1         2         3         4         5         6         7         8
#              \x202345678901234567890123456789012345678901234567890123456789012345678901234567890\x20
#                                                                          XXXXXXXXXXXXXXXXXXXXX  <- text must end in this area!
#                                                               pad out HEADINGS to here >>>   \x20

set    HEADING=\x20 EASY2BOOT - MAIN MENU  (%VER%) %B64% \x20

# use \x20 for no text at the bottom of the first menu - e.g. set HELPTEXT=\x20
set HELPTEXT=HDD0 [F7]   Back [F8]   Reboot [F9]   Power Off [F10]

#  ----- GRAPHICS MODE AND WALLPAPER -----

# set graphics mode - use 640, or 800 or 1024 - or specify full mode - e.g. 800 600 24
# 640 and 800 is supported by the default background bitmap
set GMODE=800
set MYWBMP=/_ISO/mybackground.bmp
set MYWBMPGZ=/_ISO/mybackground.bmp.gz

# -------- MENU COLOURS -------

# Colour pairs are Text/Background - i.e cyan/blue = cyan text on blue background
# Use black if a transparent background is required for menu highlight background - e.g. highlight=red/black
# Valid colours are: black, blue, green, cyan, red, magenta, brown, light-gray, dark-gray, light-blue, light-green, light-cyan, light-red, light-magenta, yellow and white.

color normal=light-cyan/black highlight=red/cyan helptext=yellow/black standard=light-cyan/black border=light-gray/black

# ----- MENU POSITION ---

# If USING 640 or 800 x-resolution - the settings below will change automatically
# wordspacing linespacing borderwidth tophelp numberofitemsinmenu topstart menuwidth rightstartposofmenu
# tophelp=topstart+noitems for menuhelp text just under menu box
set wdspace=0
set lnspace=0
set topstart=2
set rstart=3
set noitems=18
set menuw=64
set bdwidth=1
set tophelp=20

# --- AUTOMATICALLY change border parameters if 800x600 set -----

if "%GMODE%"=="800" set noitems=24
if "%GMODE%"=="800" set tophelp=26

# -- FOOTER HELP TEXT ---
#Bottom Easy2Boot Help text position YYXX
set HBTM=2800
# if in 800 hres set, put bottom help text lower down - 36 lines if 800 mode
if "%GMODE%"=="800" set HBTM=3501

#   ---- PASSWORD PROTECTION -----
# md5 text below = easy2boot
set pwd=--md5 $1$1$okAQ3AJUdhqf3TVrwKvJP1


