Skip to content

Instantly share code, notes, and snippets.

@kylemisner
Last active May 29, 2019 17:54
Show Gist options
  • Save kylemisner/095932e295e1d0694d6a8b1b1aab63c9 to your computer and use it in GitHub Desktop.
Save kylemisner/095932e295e1d0694d6a8b1b1aab63c9 to your computer and use it in GitHub Desktop.
A corrected copy of the file to fix the Intel Management Engine (ME) won't upgrade issue for Lenovo P72 laptop ((a7) me fw downgrade - request mespilock failed error)
@ECHO OFF
SET RetCode=0
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=x86 || set OS=x64
CLS
echo Checking if system needs to apply fix...
echo.
REM Check ME FW version prescence to confirm if ME information can be queried.
"%~dp0meinfowin.exe" -feat "FW Capabilities" > "%~dp0NUL"
SET RetCode=%errorlevel%
IF %RetCode%==0 GOTO Nofix
echo System needs fix...
echo Applying fix to your system. Your system will be set to Sleep after 10 seconds and will Resume automatically after 30 seconds...
echo DO NOT TURN OFF SYSTEM and DO NOT CLOSE THIS WINDOW WHILE UPDATE IS IN PROGRESS...
echo.
TIMEOUT /T 10 /NOBREAK
REM Set system to sleep for 30seconds
"%~dp0pwrtestx64_win10.exe" /sleep /c:1 /d:10 /p:30
echo Updating the ME Firmware...
echo.
TIMEOUT /T 10 /NOBREAK
:Corporate
IF %OS%==x86 GOTO Corp_32bit
:Corp_64bit
"%~dp0FWUpdLcl64.exe" -F "%~dp0CNP_H_B_Corp_FWU_Base_Production.bin" -OEMID 4C656E6F-766F-0000-0000-000000000000 -allowsv -y
GOTO RESTART
:Corp_32bit
"%~dp0FWUpdLcl.exe" -F "%~dp0CNP_H_B_Corp_FWU_Base_Production.bin" -OEMID 4C656E6F-766F-0000-0000-000000000000 -allowsv -y
GOTO RESTART
:RESTART
rem Shutdown.exe -r -t 10
:Nofix
echo Your system does not exhibit the ME problem. No need to apply this fix...
echo.
pause
:END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment