无忧启动论坛

标题: 如何使用 bcdedit 创建菜单 [打印本页]

作者: chishingchan    时间: 2023-5-26 21:06
标题: 如何使用 bcdedit 创建菜单
本帖最后由 chishingchan 于 2023-5-26 21:25 编辑

看图:
  1. Windows 旧 OS 加载器
  2. ------------------------
  3. 标识符                  {ntldr}
  4. device                  partition=C:
  5. path                    \GRLDR
  6. description             一键自动备份恢复系统
复制代码


请问如何使用 bcdedit 创建如上图的启动菜单?谢谢!

以下尝试出错!
  1. Windows 旧 OS 加载器
  2. ------------------------
  3. 标识符                  {ntldr}
  4. device                  partition=D:
  5. path                    \ntldr
  6. description             Windows XP

  7. Windows 启动加载器
  8. -------------------
  9. 标识符                  {current}
  10. device                  partition=C:
  11. path                    \Windows\system32\winload.exe
  12. description             Windows 7
  13. locale                  zh-CN
  14. loadoptions             DDISABLE_INTEGRITY_CHECKS
  15. inherit                 {bootloadersettings}
  16. osdevice                partition=C:
  17. systemroot              \Windows
  18. resumeobject            {5438009a-f880-11ed-9cbb-d72c9ed8fc43}
  19. nx                      OptIn

  20. C:\Users\Administrator>bcdedit /create {ntldr} /d "一键自动备份恢复系统"
  21. 尝试指定创建操作时发生错误。
  22. 指定项已经存在。
  23. 当文件已存在时,无法创建该文件。
复制代码

作者: chishingchan    时间: 2023-5-26 21:18
本帖最后由 chishingchan 于 2023-5-26 21:32 编辑
  1. for /f "tokens=2" %%i in ('bcdedit.exe /create /d "一键自动备份恢复系统" /application bootsector') do set id=%%i
  2. bcdedit /set %id% device partition=D:
  3. bcdedit /set %id% path \GRLDR
复制代码

  1. 实模式启动扇区
  2. ---------------------
  3. 标识符                  {5438009d-f880-11ed-9cbb-d72c9ed8fc43}
  4. device                  partition=D:
  5. path                    \OKABR
  6. description             一键自动备份恢复系统
复制代码


启动时好像是 0xC0000007 出错!
作者: chishingchan    时间: 2023-5-26 21:33
{ntldr} 被 Windows XP 占用!现在是先进入 Windows XP,再选择“一键恢复”。

作者: szwp    时间: 2023-5-26 21:39
OKABR哪来的
作者: nttwqz    时间: 2023-5-27 08:36
C:\Windows\system32>bcdedit /create {ntldr} /d "Windows XP"
项 {ntldr} 成功创建。

C:\Windows\system32>bcdedit /copy {ntldr} /d "Windows XP x64"
已将该项成功复制到 {76bc50bc-6548-11ed-83e8-382c4ab06b29}。

C:\Windows\system32>bcdedit /enum {76bc50bc-6548-11ed-83e8-382c4ab06b29}

Windows 旧 OS 加载器
------------------------
标识符                  {76bc50bc-6548-11ed-83e8-382c4ab06b29}
description             Windows XP x64
作者: chishingchan    时间: 2023-5-27 15:48
本帖最后由 chishingchan 于 2023-5-27 15:52 编辑
nttwqz 发表于 2023-5-27 08:36
C:\Windows\system32>bcdedit /create {ntldr} /d "Windows XP"
项 {ntldr} 成功创建。
  1. Windows 启动管理器
  2. --------------------
  3. 标识符                  {bootmgr}
  4. device                  partition=D:
  5. description             Windows Boot Manager
  6. locale                  zh-CN
  7. inherit                 {globalsettings}
  8. default                 {current}
  9. resumeobject            {5438009a-f880-11ed-9cbb-d72c9ed8fc43}
  10. displayorder            {ntldr}
  11.                         {current}
  12.                         {5438009e-f880-11ed-9cbb-d72c9ed8fc43}
  13. toolsdisplayorder       {memdiag}
  14. timeout                 5

  15. Windows 旧 OS 加载器
  16. ------------------------
  17. 标识符                  {ntldr}
  18. device                  partition=D:
  19. path                    \ntldr
  20. description             Windows XP

  21. Windows 启动加载器
  22. -------------------
  23. 标识符                  {current}
  24. device                  partition=C:
  25. path                    \Windows\system32\winload.exe
  26. description             Windows 7
  27. locale                  zh-CN
  28. loadoptions             DDISABLE_INTEGRITY_CHECKS
  29. inherit                 {bootloadersettings}
  30. osdevice                partition=C:
  31. systemroot              \Windows
  32. resumeobject            {5438009a-f880-11ed-9cbb-d72c9ed8fc43}
  33. nx                      OptIn

  34. Windows 旧 OS 加载器
  35. ------------------------
  36. 标识符                  {5438009e-f880-11ed-9cbb-d72c9ed8fc43}
  37. device                  partition=D:
  38. path                    \OKABR
  39. description             一键自动备份恢复系统

  40. C:\Users\Administrator>
复制代码

照着做了!还是出现错误:
  1. Windows 未能启动。原因可能是最近更改了硬件或软件。解决此问题的步骤:

  2. 1. 插入 Windows 安装光盘并重新启动计算机。
  3. 2. 选择语言设置,然后单击“下一步”。
  4. 3. 单击“修复计算机”。

  5. 如果没有此光盘,请与您的系统管理员或计算机制造商联系,以获得帮助。

  6.   文件:\OKABR

  7.   状态:0xc000007b

  8.   信息:无法加载所选项,因为应用程序丢失或损坏。
复制代码


作者: chishingchan    时间: 2023-5-27 15:57
本帖最后由 chishingchan 于 2023-5-27 16:00 编辑
  1. Microsoft Windows [版本 6.1.7601]
  2. 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

  3. C:\Users\Administrator>bcdedit /enum {5438009e-f880-11ed-9cbb-d72c9ed8fc43}

  4. Windows 旧 OS 加载器
  5. ------------------------
  6. 标识符                  {5438009e-f880-11ed-9cbb-d72c9ed8fc43}
  7. device                  partition=D:
  8. path                    \OKABR
  9. description             一键自动备份恢复系统

  10. C:\Users\Administrator>
复制代码

D:\boot.ini
  1. [boot loader]
  2. timeout=5
  3. default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
  4. [operating systems]
  5. multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /NOEXECUTE=OPTIN /FASTDETECT
  6. C:\OKABR="OneKey Auto-Backup and Restore OS"
复制代码

还是要先进入 Windows XP (NT5) 才能启动 OKABR!
作者: szwp    时间: 2023-5-27 16:27
改名上这儿学  http://bbs.wuyou.net/forum.php?mod=viewthread&tid=435875&extra=&page=3&mobile=2
作者: chishingchan    时间: 2023-5-27 17:11
szwp 发表于 2023-5-27 16:27
改名上这儿学  http://bbs.wuyou.net/forum.php?mod=viewthread&tid=435875&extra=&page=3&mobile=2

已改过!不然在 NT5 下会进入不了!
现在主要的问题是:bootmgr 启动不了 GRLDR(OKABR) ,ntldr 是可以启动 GRLDR(OKABR)
作者: szwp    时间: 2023-5-27 17:20
改名那贴就是bcd启动的
作者: nttwqz    时间: 2023-5-27 17:31
chishingchan 发表于 2023-5-27 15:48
照着做了!还是出现错误:

原来是grldr……

bcdedit /create /application bootsector /d "test"
作者: nttwqz    时间: 2023-5-27 20:07
换成原版未更改的grldr试试,如果可行,那就是你这个文件可能有问题

原版grldr放激活分区根目录,并将device改为boot,激活分区使用grldr或ntfs文件系统,不要使用非主流的文件系统,分配单元大小使用默认值,不可以自定义,安全启动也要关闭。

尝试bootsect /nt60 C: /mbr /force

bootmgr引导grldr我记得不复杂,就是实模式启动扇区,还不行只能从头弄。
作者: chishingchan    时间: 2023-5-31 18:03
未结贴,自己顶一下!
作者: szwp    时间: 2023-5-31 19:46
一楼要求C,后面变D了,需求不明确
作者: szwp    时间: 2023-6-1 08:29
bcdedit /set {ntldr} device partition=c:
bcdedit /set {ntldr} path \GRLDR
bcdedit /set {ntldr} description 一键自动备份恢复系统
bcdedit /enum {ntldr}

将结果和一楼的要求比较。
作者: chishingchan    时间: 2023-6-1 09:29
szwp 发表于 2023-6-1 08:29
bcdedit /set {ntldr} device partition=c:
bcdedit /set {ntldr} path \GRLDR
bcdedit /set {ntldr} des ...

因为也存在 XP 启动项,所以参考了 5# 的例子:
bcdedit /copy {ntldr} /d "一键自动备份恢复系统"
作者: chishingchan    时间: 2023-6-1 09:32
szwp 发表于 2023-6-1 08:29
bcdedit /set {ntldr} device partition=c:
bcdedit /set {ntldr} path \GRLDR
bcdedit /set {ntldr} des ...

改写后的 OKABR 的测试结果不行,等待有空再测试原版 GRLDR 的测试结果
作者: szwp    时间: 2023-6-1 09:43
现在的需求在几楼?
作者: chishingchan    时间: 2023-6-1 09:59
szwp 发表于 2023-6-1 09:43
现在的需求在几楼?

NT6 的菜单:
  1. Windows XP
  2. Windows 7
  3. 一键自动备份恢复系统
复制代码






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