最近在做关于还原后系统启动的东西。
UEFI模式下可以用到BCDBOOT。
又找了一下关于BCDEDIT的介绍。
文笔不好直接上干的吧!
----------------------------------------------------------------------------------------------------
@echo off
setlocal
:: Do not use spaces in paths and do
:: NOT wrap in quotes
set BCDEDIT=%SYSTEMROOT%\system32\bcdedit.exe
set BCDSTORE=D:\BCD3
::___________________________________
%BCDEDIT% /createstore %BCDSTORE%
%BCDEDIT% /store %BCDSTORE% /create {bootmgr} /d "Load's Windows"
%BCDEDIT% /store %BCDSTORE% /set {bootmgr} device partition=\Device
\HarddiskVolume2
%BCDEDIT% /store %BCDSTORE% /set {bootmgr} path \EFI\Microsoft\Boot
\bootmgfw.efi
%BCDEDIT% /store %BCDSTORE% /timeout 25
%BCDEDIT% /store %BCDSTORE% /set {bootmgr} locale "ja-JP"
for /f "tokens=2" %%A in ('%BCDEDIT% /store %BCDSTORE% /create
/application osloader') do (set guid=%%A)
%BCDEDIT% /store %BCDSTORE% /set %guid% device partition=C:
%BCDEDIT% /store %BCDSTORE% /set %guid% path \Windows
\system32\winload.efi
%BCDEDIT% /store %BCDSTORE% /set %guid% osdevice partition=C:
%BCDEDIT% /store %BCDSTORE% /set %guid% locale "ja-jp"
%BCDEDIT% /store %BCDSTORE% /set %guid% systemroot \Windows
%BCDEDIT% /store %BCDSTORE% /set %guid% description "Load's Windows 8"
%BCDEDIT% /store %BCDSTORE% /displayorder %guid% /addfirst
%BCDEDIT% /store %BCDSTORE% /default %guid%
endlocal
pause
----------------------------------------------------------------------------------------------------
保存位bat文件,管理员权限下执行就可以构筑自己的BCD了。
注 在导入前需要备份原有的BCD文件。
原文出处http://diddy.boot-land.net/bcdedit/files/bcdedit_basics.htm
还望诸位指教。