ThinkPad 恢复蓝键功能

/ #电脑相关 / 0 comment

为什么会如此简单就成功了呢。悲剧,害我还折腾了半天 。

引导分区SYSTEM_DRV和备份分区Lenovo_Recovery都还没有损坏。系统是Windows 7家庭基础版。

我的方法:直接进入系统目录:C:\Program Files\Common Files\Lenovo\BMGR

运行里面的InstallVirtualPartition.cmd就完事。

看下里面的源码:

    set BCDEDIT="%windir%\system32\bcdedit.exe"
    IF NOT EXIST %BCDEDIT% (
    set BCDEDIT="c:\swwork\bcdedit.exe"
    )

    REM
    REM Configure VirtualPartition BCD entries
    REM

    set DRIVE=boot

    set WINPE_GUID={572bcd55-ffa7-11d9-aae0-0007e994107d}

    set MAINOS={default}
    if not "%1"=="" (
      goto ShrinkwrapWin7
    )	

    %BCDEDIT% -create {ramdiskoptions} -d "Ramdisk options"
    rem %BCDEDIT% -set {ramdiskoptions} ramdisksdidevice partition=%DRIVE%
    %BCDEDIT% -set {ramdiskoptions} ramdisksdidevice %DRIVE%
    %BCDEDIT% -set {ramdiskoptions} ramdisksdipath \boot\boot.sdi

    %BCDEDIT% -create %WINPE_GUID% -d "WinPE" -application OSLOADER
    %BCDEDIT% -set %WINPE_GUID% device ramdisk=[%DRIVE%]\tvtos\winpe.wim,{ramdiskoptions}
    %BCDEDIT% -set %WINPE_GUID% path \windows\system32\boot\winload.exe
    %BCDEDIT% -set %WINPE_GUID% osdevice ramdisk=[%DRIVE%]\tvtos\winpe.wim,{ramdiskoptions}
    %BCDEDIT% -set %WINPE_GUID% systemroot \windows
    %BCDEDIT% -set %WINPE_GUID% detecthal yes
    %BCDEDIT% -set %WINPE_GUID% nx optin
    %BCDEDIT% -set %WINPE_GUID% winpe yes

    %bcdedit% -deletevalue {globalsettings} extendedinput 

    %bcdedit% -set {bootmgr} extendedinput 1
    %bcdedit% -set {bootmgr} custom:0x0000000054000001 %WINPE_GUID%
    %bcdedit% -set {bootmgr} customactions 0x00010000BA000001 0x0000000054000001
    goto END

    :ShrinkwrapWin7
    set DRIVE=%1
    %BCDEDIT% -create {ramdiskoptions} -d "Ramdisk options"
    %BCDEDIT% -set {ramdiskoptions} ramdisksdidevice partition=%DRIVE%
    %BCDEDIT% -set {ramdiskoptions} ramdisksdipath \boot\boot.sdi

    %BCDEDIT% -create %WINPE_GUID% -d "WinPE" -application OSLOADER
    %BCDEDIT% -set %WINPE_GUID% device ramdisk=[%DRIVE%]\tvtos\winpe.wim,{ramdiskoptions}
    %BCDEDIT% -set %WINPE_GUID% path \windows\system32\boot\winload.exe
    %BCDEDIT% -set %WINPE_GUID% osdevice ramdisk=[%DRIVE%]\tvtos\winpe.wim,{ramdiskoptions}
    %BCDEDIT% -set %WINPE_GUID% systemroot \windows
    %BCDEDIT% -set %WINPE_GUID% detecthal yes
    %BCDEDIT% -set %WINPE_GUID% nx optin
    %BCDEDIT% -set %WINPE_GUID% winpe yes

    %bcdedit% -deletevalue {globalsettings} extendedinput 

    %bcdedit% -set {bootmgr} extendedinput 1
    %bcdedit% -set {bootmgr} custom:0x0000000054000001 %WINPE_GUID%
    %bcdedit% -set {bootmgr} customactions 0x00010000BA000001 0x0000000054000001

    :END

看得主要就是修改BCD的引导,重点应该就在 set WINPE_GUID={572bcd55-ffa7-11d9-aae0-0007e994107d}。

只是记录一下这个折腾的经历~~

回应