@ECHO OFF

reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=x86 || set OS=x64

CLS

echo Updating the ME Firmware...
echo.


%~dp0meinfowin.exe -feat "M3 Autotest" -value "Enabled" > %~dp0NUL
If errorlevel 1 goto Consumer


:Corporate

IF %OS%==x86 GOTO Corp_32bit

:Corp_64bit
%~dp0FWUpdLcl64.exe -F %~dp0ME9.5_5M_Production.BIN -OEMID 4C656E6F-766F-0000-0000-000000000000 -generic -allowsv -y
GOTO RESTART

:Corp_32bit
%~dp0FWUpdLcl.exe -F %~dp0ME9.5_5M_Production.BIN -OEMID 4C656E6F-766F-0000-0000-000000000000 -generic -allowsv -y
GOTO RESTART


:Consumer

IF %OS%==x86 GOTO Cons_32bit

:Cons_64bit
%~dp0FWUpdLcl64.exe -F %~dp0ME9.5_1.5M_Production.BIN -OEMID 4C656E6F-766F-0000-0000-000000000000 -generic -allowsv -y
GOTO RESTART

:Cons_32bit
%~dp0FWUpdLcl.exe -F %~dp0ME9.5_1.5M_Production.BIN -OEMID 4C656E6F-766F-0000-0000-000000000000 -generic -allowsv -y
GOTO RESTART


:RESTART
Shutdown.exe -r -t 10

:END
