无忧启动论坛

标题: 怎样用bcdedit.exe 编辑第二个Xp03PE启动项才能正常启动 [打印本页]

作者: owl0001    时间: 2024-9-11 10:34
标题: 怎样用bcdedit.exe 编辑第二个Xp03PE启动项才能正常启动
本帖最后由 owl0001 于 2024-9-11 16:50 编辑

我用这种方式编辑时
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /create {ntldr} /d "[02] BIOS Windows XP PE"
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} device boot
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} description "[02] BIOS Windows XP PE"
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} path \WXPE\SETUPLDR.BIN
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /displayorder {ntldr} /addlast

set var=0123456789abcdef
set id=&for /l %%i in (1,1,32) do (set /a n=!random!%%16&for %%j in (!n!) do set id=!id!!var:~%%j,1!)
set id=!id:~0,8!-!id:~8,4!-!id:~12,4!-!id:~16,4!-!id:~20,12!
set id={%id%}

bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /create %id% /d "[03] BIOS Windows 03 PE" /application osloader
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set %id% device boot
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set %id% description "[03] BIOS Windows 03 PE"
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set %id% path \sources\03PE
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /displayorder %id% /addlast
这样编辑时03PE在boot\bcd中有启动项 但是启动时会报错
当我把03PE里的%id%换成{ntldr}如下
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /create {ntldr} /d "[03] BIOS Windows 03 PE"
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} device boot
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} description "[03] BIOS Windows 03 PE"
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} path \sources\03PE
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /displayorder {ntldr} /addlast
这样时bcd中没有03PE的启动项了.请教大神们要怎么样编辑才正常
作者: 孟仁飞    时间: 2024-9-11 10:47
学习
作者: wn168cn@163.com    时间: 2024-9-11 11:20
学习一下
作者: hilsonma    时间: 2024-9-11 12:52
这样试一下:
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /create {ntldr} /d "[09] BIOS Windows 03 PE"
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} device boot
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} path \sources\03PE\setupldr.bin
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /displayorder {ntldr} /addlast

注:
/set {ntldr} path 后面必须是一个包含路径的类似ntldr的文件
/set {ntldr} description 的作用跟 /create {ntldr} /d 中的/d参数是一样的,两者用其中之一就可以了
作者: owl0001    时间: 2024-9-11 13:45
前面搞错了[09]应该是[03]
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /create {ntldr} /d "[03] BIOS Windows 03 PE"
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} device boot
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} description "[03] BIOS Windows 03 PE"
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set {ntldr} path \sources\03PE
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /displayorder {ntldr} /addlast
作者: owl0001    时间: 2024-9-11 13:46
hilsonma 发表于 2024-9-11 12:52
这样试一下:
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /create {ntldr} /d "[09] BIOS Windows 03 P ...

启动文件本来就是叫03PE

作者: owl0001    时间: 2024-9-11 16:49
在liangnijian老大的指点下把
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /create %id% /d "[03] BIOS Windows 03 PE" /application osloader
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set %id% device boot
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set %id% description "[03] BIOS Windows 03 PE"
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /set %id% path \sources\03PE
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /displayorder %id% /addlast
第一行改成
bcdedit.exe /store "%~dp0temp\iso\boot\bcd" /create %id% /d "[03] BIOS Windows 03 PE" /application BOOTSECTOR
就正常了




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