# Looks for a BIOS string to find PC Model and then run the correct ISO file for that system
# force.isope01 forces it to run as .isope01 - you can force the iso to run as any type by changing 2nd-last line
# Search strings (e.g. "eeepc") are not case-sensitive
# All ISO files must be in same folder as this .mnu file
# 0x7ff+0x01 searches 512 bytes at end of BIOS ROM, 0x600+0x40 will search the BIOS VGA ROM area
# 0x680+0x180 searches all of BIOS from 0xD000:0 to 0xFFFF:F (and so will be slower)
# remove the " > nul" text if you want to see the strings that it has found

title Run WinPE ISO (detect system model)\n Auto-detect based on BIOS strings
# if you edit the line below, it will use that ISO as the default ISO if no BIOS string match is found - e.g. set ISO=AsusEeePC.iso
set ISO=

set MATCH=

# TESTS START HERE - edit lines for your PCs

# Example to run Windows 8 Install ISO (needs Removable drive or WINHELPER flash drive) - isos are in \_ISO\WINDOWS\WIN8 folder
set GOTSTR=
# Specify XML file in MFOLDER folder (e.g. Win8\ has\ spaces\ in\ name.xml)
# OR to choose XML or Product Key do not set XML variable
# set XML=%MFOLDER%/NO\ KEY\ (choose\ a\ version\ to\ install).xml
set XML=
set ISO=Win832.iso
if not exist MATCH call /%grub%/SearchBS.g4b 0x680+0x180 "Inspiron" > nul
if "%GOTSTR%"=="1" set NOWMENU=1 && set MFOLDER=/_ISO/WINDOWS/WIN8 && /%grub%/RunWin8.g4b %MFOLDER% %XML% && configfile (md)0xa000+0x50


set GOTSTR=
if not exist MATCH call /%grub%/SearchBS.g4b 0x780+0x80 "eeepc" > nul
if "%GOTSTR%"=="1" set ISO=AsusEeePC.iso && set MATCH=1

set GOTSTR=
if not exist MATCH call /%grub%/SearchBS.g4b 0x780+0x80 "inspiron 530" > nul
if "%GOTSTR%"=="1" set ISO=Dell530.ima && set MATCH=1

set GOTSTR=
if not exist MATCH call /%grub%/SearchBS.g4b 0x680+0x40 "ATI technologies" > nul
if "%GOTSTR%"=="1" set ISO=ATIVGA.isope01 && set MATCH=1

set GOTSTR=
if not exist MATCH call /%grub%/SearchBS.g4b 0x680+0x180 "samsung" > nul
if "%GOTSTR%"=="1" set ISO=Hirens15.2.isowinvh && set MATCH=1


# Example to run .imgPTN file is certain model detected (e.g. Win10 install)
set GOTSTR=
if not exist MATCH call /%grub%/SearchBS.g4b 0x680+0x180 "Predator" > nul
if "%GOTSTR%"=="1" set ISO=Win10Pro.imgPTNAUTO && set MATCH=1


# ADD MORE TESTS HERE FOR MORE SYSTEMS...



set GOTSTR=
if not exist MATCH echo WARNING: BIOS NOT RECOGNISED
if exist ISO echo USING DEFAULT ISO
if not exist MATCH if not exist ISO set /p A=Press a key... && set MFOLDER=/_ISO/MAINMENU && set MATCH= && configfile (md)0xa000+0x50
if exist ISO && pause --wait=3  BOOTING %ISO%...
set MATCH=
#/%grub%/QRUN.g4b force.isope01 $HOME$/%ISO%
/%grub%/QRUN.g4b $HOME$/%ISO%
boot