帮写个CMD命令添加pe文件到BCD启动菜单

查看 188|回复 10
作者:adminkk   
硬盘格式:GPT
BCD文件在ESP分区
PE文件 在D:\PE\pe.wim
boot.sdi 在D:\pe\boot.sdi

文件, 分区, 命令

lcjok92021   
沙发
h07799486   
BOOTICE.BCDEDIT等软件不都有这种功能么?
huixiaochuna   

邪恶海盗 发表于 2023-1-12 20:57
BOOTICE.BCDEDIT等软件不都有这种功能么?

用软件当然会,想要弄个封装系用的
nicebird   
楼主解决了吗,这个问题的答案我也想知道啊
Kylin30   

ZMLoveLH 发表于 2023-1-12 21:52
楼主解决了吗,这个问题的答案我也想知道啊

还没有呢
Danswerme   
必须用bcdedit啊
dTb   

szwp 发表于 2023-1-13 07:00
必须用bcdedit啊

相大师,你出手就很简单了
lepig   
以前保存的 你改改吧
@echo off
pushd "%~dp0"
echo.&echo.
if exist bcd_tmp del bcd_tmp
bcdedit >temp_bcd.txt 2>nul
type temp_bcd.txt | find /i "winload.efi" &&(set "winload=winload.efi")||(set winload=winload.exe)
type temp_bcd.txt | find "{ramdiskoptions}" >nul
IF ERRORLEVEL 1 goto ramd
cls&echo.&echo.
:start
for /f "delims={,} tokens=2" %%a in ('bcdedit -create /d "Windows  PE" -application osloader  ') do set ID={%%a}
bcdedit %bcddir% -set %ID% device ramdisk="[boot]\Sources\WinPE.WIM,{ramdiskoptions}"
bcdedit %bcddir% -set %ID% osdevice ramdisk="[boot]\Sources\WinPE.WIM,{ramdiskoptions}"
bcdedit %bcddir% -set %ID% path \windows\system32\boot\%winload%
bcdedit %bcddir% -set %ID% locale zh-CN
bcdedit %bcddir% -set %ID% systemroot \windows
bcdedit %bcddir% -set %ID% detecthal no
bcdedit %bcddir% -set %ID% winpe yes
bcdedit %bcddir% -set %ID% testsigning yes
bcdedit %bcddir% -set %ID% nointegritychecks yes
bcdedit %bcddir% -set %ID% pae forceenable
bcdedit %bcddir% -set %ID% bootmenupolicy Legacy
bcdedit %bcddir% -displayorder %ID% -addlast
goto end
:ramd
cls&echo.&echo.
bcdedit /create {ramdiskoptions}
bcdedit /set {ramdiskoptions} ramdisksdidevice "boot"
bcdedit /set {ramdiskoptions} ramdisksdipath \efi\boot.sdi
goto start
:end
echo.&echo.&echo Add-Wim to BCD OK !!! &timeout /t 5 &exit
fsl龙行天下   
cmd里运行regedit这个进行管理不行么
您需要登录后才可以回帖 登录 | 立即注册

返回顶部