无忧启动论坛

标题: 帮写个CMD命令添加pe文件到BCD启动菜单 [打印本页]

作者: ggl    时间: 2023-1-12 20:36
标题: 帮写个CMD命令添加pe文件到BCD启动菜单
硬盘格式:GPT
BCD文件在ESP分区

PE文件 在D:\PE\pe.wim
boot.sdi 在D:\pe\boot.sdi




作者: conlin888    时间: 2023-1-12 20:47
沙发
作者: 邪恶海盗    时间: 2023-1-12 20:57
BOOTICE.BCDEDIT等软件不都有这种功能么?
作者: ggl    时间: 2023-1-12 20:58
邪恶海盗 发表于 2023-1-12 20:57
BOOTICE.BCDEDIT等软件不都有这种功能么?

用软件当然会,想要弄个封装系用的
作者: ZMLoveLH    时间: 2023-1-12 21:52
楼主解决了吗,这个问题的答案我也想知道啊
作者: ggl    时间: 2023-1-12 22:54
ZMLoveLH 发表于 2023-1-12 21:52
楼主解决了吗,这个问题的答案我也想知道啊

还没有呢

作者: szwp    时间: 2023-1-13 07:00
必须用bcdedit啊
作者: mrzhonghb    时间: 2023-1-13 08:31
szwp 发表于 2023-1-13 07:00
必须用bcdedit啊

相大师,你出手就很简单了
作者: oym2016    时间: 2023-1-13 08:45
以前保存的 你改改吧

@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
作者: adminkk    时间: 2023-1-13 16:44
cmd里运行regedit这个进行管理不行么
作者: 353477858    时间: 2023-1-14 21:00
沙发
作者: nowayer    时间: 2023-12-6 07:04
提示: 作者被禁止或删除 内容自动屏蔽
作者: yyz2191958    时间: 2023-12-6 07:47
oym2016 发表于 2023-1-13 08:45
以前保存的 你改改吧

@echo off

助人为乐
作者: taotao00586    时间: 2024-1-28 08:25
感谢分享




欢迎光临 无忧启动论坛 (http://bbs.wuyou.net/) Powered by Discuz! X3.3