构筑属于自己的BCD

最近在做关于还原后系统启动的东西。

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


还望诸位指教。


评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值