@echo off
if exist "%SystemRoot%\SysWOW64" path %path%;%windir%\SysNative;%SystemRoot%\SysWOW64;%~dp0
bcdedit >nul
if '%errorlevel%' NEQ '0' (goto UACPrompt) else (goto UACAdmin)
:UACPrompt
%2 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","%~1 ::","","runas",1)(window.close)&exit
exit /B
:UACAdmin
cd /d "%~dp0"
@echo off
:again
set BIOS_NAME_FIXED=MGBOX_107_Prod.bin
echo "%~nx1"
if "%~nx1" NEQ "" (
  echo FPTW64.exe /f "%~nx1"
  FPTW64.exe /f "%~nx1"
) else (
    echo FPTW64.exe /f %BIOS_NAME_FIXED%
    FPTW64.exe /f %BIOS_NAME_FIXED%
)
if errorlevel 1 goto error1
echo FPTW64.exe /greset
FPTW64.exe /greset
goto exit1
:error1
echo Wrong System!!! Please make sure you run the BIOS update package with proper system then try again.
pause
:exit1
pause