ggl 发表于 2023-1-12 20:36:27

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

硬盘格式:GPT
BCD文件在ESP分区

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



conlin888 发表于 2023-1-12 20:47:01

沙发

邪恶海盗 发表于 2023-1-12 20:57:49

BOOTICE.BCDEDIT等软件不都有这种功能么?

ggl 发表于 2023-1-12 20:58:39

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

用软件当然会,想要弄个封装系用的

ZMLoveLH 发表于 2023-1-12 21:52:26

楼主解决了吗,这个问题的答案我也想知道啊

ggl 发表于 2023-1-12 22:54:20

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

还没有呢

szwp 发表于 2023-1-13 07:00:41

必须用bcdedit啊

mrzhonghb 发表于 2023-1-13 08:31:36

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

相大师,你出手就很简单了

oym2016 发表于 2023-1-13 08:45:20

以前保存的 你改改吧

@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 "WindowsPE" -application osloader') do set ID={%%a}
bcdedit %bcddir% -set %ID% device ramdisk="\Sources\WinPE.WIM,{ramdiskoptions}"
bcdedit %bcddir% -set %ID% osdevice ramdisk="\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:14

cmd里运行regedit这个进行管理不行么

353477858 发表于 2023-1-14 21:00:36

沙发

nowayer 发表于 2023-12-6 07:04:15

yyz2191958 发表于 2023-12-6 07:47:41

oym2016 发表于 2023-1-13 08:45
以前保存的 你改改吧

@echo off


助人为乐

taotao00586 发表于 2024-1-28 08:25:23

感谢分享
页: [1]
查看完整版本: 帮写个CMD命令添加pe文件到BCD启动菜单