无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 5775|回复: 10
打印 上一主题 下一主题

根据模板创建BCD文件的批处理

[复制链接]
跳转到指定楼层
1#
发表于 2010-8-19 18:29:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
今天拉上网线了,发个贴子庆祝一下。

每次修改BCD文件的时候,用BCDTools只能一条一条的添加,当条目多的时候就更不方便了,因为我的外置鼠标有毛病了,而触摸板我又用不习惯,所有就写了个批处理,按照模板中的内容批量添加到BCD文件中。

先说下模板内容:


  1. [BootSection]
  2. ;方括号的内容任意,只为了区分一个条目的开始
  3. ;Windows Boot Manager
  4. ;--------------------
  5. ;分号打头的行是注释
  6. identifier={bootmgr}
  7. description=Windows Boot Manager
  8. locale=zh-CN
  9. inherit={globalsettings}
  10. ;default={default}
  11. ;displayorder={default}
  12. toolsdisplayorder={memdiag}
  13. timeout=5
  14. @loader=bootmgr
  15. ;@loader=代表该条目类型,bootmgr代表这一节的内容是创建一个启动管理器;osloader代表Windows Vista以上系统的启动项;ntldr代表XP系统的启动项;bootsector代表实模式启动项如grldr;Device代表创建一个启动设备。如果没有定义@loader或为空,并且identifier不为空,则按该ID值创建条目,如identifier={globalsettings},则创建一个全局设置供其它项继承。
  16. ;除了@打头的变量和注释的变量都将添加到BCD文件中。
  17. ;默认创建的BCD文件名为mybcd,如要修改,编辑批处理文件修改set bcd=mybcd这一行
  18. ;默认的配置文件名为bcd.ini,如要修改,编辑批处理文件修改set bcdcfg=bcd.ini这一行

  19. [BootSection]
  20. ;Windows Boot Loader
  21. ;-------------------
  22. ;identifier={default}
  23. device=ramdisk=[boot]\sources\boot.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
  24. path=\windows\system32\boot\winload.exe
  25. description=安装 Windows 7
  26. locale=zh-CN
  27. inherit={bootloadersettings}
  28. osdevice=ramdisk=[boot]\sources\boot.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
  29. systemroot=\windows
  30. detecthal=Yes
  31. winpe=Yes
  32. sos=No
  33. debug=No
  34. ems=Yes
  35. @default=Yes
  36. @loader=osloader
  37. [BootSection]
  38. ;Windows Boot Loader
  39. ;-------------------
  40. ;identifier={ae244c6a-9410-11df-8d8b-005056c00001}
  41. device=ramdisk=[boot]\WinPE\WinPE_x86.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
  42. path=\windows\system32\boot\winload.exe
  43. description=启动 32位 Windows PE
  44. locale=zh-CN
  45. inherit={bootloadersettings}
  46. osdevice=ramdisk=[boot]\WinPE\WinPE_x86.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
  47. systemroot=\windows
  48. detecthal=Yes
  49. winpe=Yes
  50. ems=Yes
  51. @loader=osloader
  52. [BootSection]
  53. ;Windows Boot Loader
  54. ;-------------------
  55. ;identifier={cc2fae8e-9410-11df-8d8b-005056c00001}
  56. device=ramdisk=[boot]\WinPE\WinPE_x64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
  57. path=\windows\system32\boot\winload.exe
  58. description=启动 64位 Windows PE
  59. locale=zh-CN
  60. inherit={bootloadersettings}
  61. osdevice=ramdisk=[boot]\WinPE\WinPE_x64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
  62. systemroot=\windows
  63. detecthal=Yes
  64. winpe=Yes
  65. ems=Yes
  66. @loader=osloader
  67. [BootSection]
  68. ;Windows Boot Loader
  69. ;-------------------
  70. ;identifier={061e6d2c-9418-11df-8d8b-005056c00001}
  71. device=ramdisk=[boot]\WinPE\WinPE_Standard_x86.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
  72. path=\windows\system32\boot\winload.exe
  73. description=启动 32位 Windows PE Standard
  74. locale=zh-CN
  75. inherit={bootloadersettings}
  76. osdevice=ramdisk=[boot]\WinPE\WinPE_Standard_x86.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
  77. systemroot=\windows
  78. detecthal=Yes
  79. winpe=Yes
  80. ems=Yes
  81. @loader=osloader
  82. [BootSection]
  83. ;Windows Boot Loader
  84. ;-------------------
  85. ;identifier={cb9f5b02-9417-11df-8d8b-005056c00001}
  86. device=ramdisk=[boot]\WinPE\WinPE_Standard_x64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
  87. path=\windows\system32\boot\winload.exe
  88. description=启动 64位 Windows PE Standard
  89. locale=zh-CN
  90. inherit={bootloadersettings}
  91. osdevice=ramdisk=[boot]\WinPE\WinPE_Standard_x64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
  92. systemroot=\windows
  93. detecthal=Yes
  94. winpe=Yes
  95. ems=Yes
  96. @loader=osloader
  97. [BootSection]
  98. ;Windows Boot Loader
  99. ;-------------------
  100. ;identifier={2960d7ca-9413-11df-8d8b-005056c00001}
  101. device=ramdisk=[boot]\WinPE\Win7PE.WIM,{7619dcc8-fafe-11d9-b411-000476eba25f}
  102. path=\windows\system32\boot\winload.exe
  103. description=启动 Windows 7PE3.0 正式版
  104. locale=zh-CN
  105. inherit={bootloadersettings}
  106. osdevice=ramdisk=[boot]\WinPE\Win7PE.WIM,{7619dcc8-fafe-11d9-b411-000476eba25f}
  107. systemroot=\windows
  108. detecthal=Yes
  109. winpe=Yes
  110. ems=Yes
  111. @loader=osloader
  112. [BootSection]
  113. ;Windows Legacy OS Loader
  114. ;------------------------
  115. identifier={ntldr}
  116. device=boot
  117. path=\i386\SETUPLDR.BIN
  118. description=安装 Windows XP
  119. @loader=ntldr
  120. [BootSection]
  121. ;Windows Boot Loader
  122. ;-------------------
  123. ;identifier={6dc63144-940e-11df-8d8b-005056c00001}
  124. device=boot
  125. path=\boot\SETUPLXP.BIN
  126. description====我心如水_PE_v15.00_系列===
  127. locale=zh-CN
  128. inherit={bootloadersettings}
  129. osdevice=boot
  130. systemroot=boot
  131. detecthal=Yes
  132. winpe=Yes
  133. ems=Yes
  134. @loader=osloader
  135. [BootSection]
  136. ;Windows Legacy OS Loader
  137. ;------------------------
  138. ;identifier={a7022110-971b-11df-ad24-b1e8eb19eb65}
  139. device=boot
  140. path=\boot\SETUPLXP.BIN
  141. description=1.Microsoft WinXP Sp3 PE
  142. @loader=ntldr
  143. [BootSection]
  144. ;Windows Legacy OS Loader
  145. ;------------------------
  146. ;identifier={8601d808-940e-11df-8d8b-005056c00001}
  147. device=boot
  148. path=\boot\SETUPL03.BIN
  149. description=2.Windows Server 2003 PE
  150. @loader=ntldr
  151. [BootSection]
  152. ;Windows Legacy OS Loader
  153. ;------------------------
  154. ;identifier={9835346e-9253-11df-8463-000ae6f70225}
  155. device=boot
  156. path=\boot\SETUPLWQ.BIN
  157. description=3.Server 2003 PE 全内置网启版
  158. @loader=ntldr
  159. [BootSection]
  160. ;Windows Legacy OS Loader
  161. ;------------------------
  162. ;identifier={9c936350-9253-11df-8463-000ae6f70225}
  163. device=boot
  164. path=\boot\SETUPLWH.BIN
  165. description=4.Server 2003 PE 全内置维护版
  166. @loader=ntldr
  167. [BootSection]
  168. ;Windows Legacy OS Loader
  169. ;------------------------
  170. ;identifier={ac1c35b8-9253-11df-8463-000ae6f70225}
  171. device=boot
  172. path=\WXPE\SETUPLDR.BIN
  173. description=5.Server 2003 PE 小内存维护版
  174. @loader=ntldr
  175. [BootSection]
  176. ;Real-mode Boot Sector
  177. ;---------------------
  178. ;identifier={d6692e84-9253-11df-8463-000ae6f70225}
  179. device=boot
  180. path=\boot\GRLDR.BIN
  181. description=6.切换到 GRUB 菜单
  182. @loader=bootsector
  183. [BootSection]
  184. ;Real-mode Boot Sector
  185. ;---------------------
  186. ;identifier={f099831c-9253-11df-8463-000ae6f70225}
  187. device=boot
  188. path=\boot\LOADER.BIN
  189. description=7.切换到 EZBOOT 菜单
  190. @loader=bootsector
  191. [BootSection]
  192. ;Real-mode Boot Sector
  193. ;---------------------
  194. ;identifier={eeab6256-9680-11df-8d90-005056c00001}
  195. device=boot
  196. path=\boot\MAXDOS.BIN
  197. description=8.MaxDOS Plus 工具箱
  198. @loader=bootsector
  199. [BootSection]
  200. ;Real-mode Boot Sector
  201. ;---------------------
  202. ;identifier={0b4ec164-9681-11df-8d90-005056c00001}
  203. device=boot
  204. path=\boot\DTS117U.BIN
  205. description=9.DOS 时代组合工具箱
  206. @loader=bootsector
  207. [BootSection]
  208. ;Real-mode Boot Sector
  209. ;---------------------
  210. ;identifier={2bfa7aac-9681-11df-8d90-005056c00001}
  211. device=boot
  212. path=\boot\GHOST.BIN
  213. description=10.GHOST 多版本集合包
  214. @loader=bootsector
  215. [BootSection]
  216. ;Real-mode Boot Sector
  217. ;---------------------
  218. ;identifier={4ae85c36-9681-11df-8d90-005056c00001}
  219. device=boot
  220. path=\boot\G_GDISK.BIN
  221. description=11.G_GDISK 一键分区
  222. @loader=bootsector
  223. [BootSection]
  224. ;Real-mode Boot Sector
  225. ;---------------------
  226. ;identifier={74e909c2-9681-11df-8d90-005056c00001}
  227. device=boot
  228. path=\boot\DM957E.BIN
  229. description=12.DM 9.57 快速分区
  230. @loader=bootsector
  231. [BootSection]
  232. ;Real-mode Boot Sector
  233. ;---------------------
  234. ;identifier={91617e7c-9681-11df-8d90-005056c00001}
  235. device=boot
  236. path=\boot\HDDREG.BIN
  237. description=13.磁盘坏道修复 HDDREG
  238. @loader=bootsector
  239. [BootSection]
  240. ;Real-mode Boot Sector
  241. ;---------------------
  242. ;identifier={aa4409dc-9681-11df-8d90-005056c00001}
  243. device=boot
  244. path=\boot\DGDOS.BIN
  245. description=14.DISKGEN 硬盘管理
  246. @loader=bootsector
  247. [BootSection]
  248. ;Real-mode Boot Sector
  249. ;---------------------
  250. ;identifier={cef5bb04-9681-11df-8d90-005056c00001}
  251. device=boot
  252. path=\boot\HDBOOT.BIN
  253. description=15.从硬盘启动计算机
  254. @loader=bootsector
  255. [BootSection]
  256. ;Real-mode Boot Sector
  257. ;---------------------
  258. ;identifier={eb40e310-9681-11df-8d90-005056c00001}
  259. device=boot
  260. path=\boot\REBOOT.BIN
  261. description=16.重新启动计算机
  262. @loader=bootsector
  263. [BootSection]
  264. ;Real-mode Boot Sector
  265. ;---------------------
  266. ;identifier={0d608b30-9682-11df-8d90-005056c00001}
  267. device=boot
  268. path=\boot\POWEROFF.BIN
  269. description=17.关闭计算机
  270. @loader=bootsector
  271. [BootSection]
  272. ;EMS Settings
  273. ;------------
  274. identifier={emssettings}
  275. bootems=Yes
  276. [BootSection]
  277. ;Global Settings
  278. ;---------------
  279. identifier={globalsettings}
  280. locale=zh-CN
  281. inherit={emssettings}
  282. [BootSection]
  283. ;Boot Loader Settings
  284. ;--------------------
  285. identifier={bootloadersettings}
  286. locale=zh-CN
  287. inherit={globalsettings}{$x20}{hypervisorsettings}
  288. ;{$x20}代表空格
  289. [BootSection]
  290. ;Hypervisor Settings
  291. ;-------------------
  292. identifier={hypervisorsettings}
  293. description=Hypervisor Settings
  294. hypervisordebugtype=Serial
  295. hypervisordebugport=1
  296. hypervisorbaudrate=115200
  297. [BootSection]
  298. ;Device options
  299. ;--------------
  300. ;identifier={7619dcc8-fafe-11d9-b411-000476eba25f}
  301. ramdisksdidevice=boot
  302. ramdisksdipath=\boot\boot.sdi
  303. @loader=Device

复制代码


现在有事要出去,等完了再加其它说明,其实看看程序很简单,要添加功能很容易。
现先把文件传上来。

MakeBCD.cmd.rar

1.32 KB, 下载次数: 335, 下载积分: 无忧币 -2

批处理文件

BCD.ini.rar

1.48 KB, 下载次数: 331, 下载积分: 无忧币 -2

配置文件

评分

参与人数 1无忧币 +5 收起 理由
linyehua + 5 这样方便多了

查看全部评分

2#
发表于 2010-8-19 18:35:14 | 只看该作者
支持下,看着也很方便的.....
回复

使用道具 举报

3#
发表于 2010-8-19 18:48:41 | 只看该作者
支持一下。
回复

使用道具 举报

4#
发表于 2010-8-30 23:15:45 | 只看该作者
下了就要顶,方法很好,我用其它机器上的BCD复制到另外一台机器上会变,不知道为什么
回复

使用道具 举报

5#
发表于 2010-8-30 23:33:35 | 只看该作者
这个很方便  

支持了
回复

使用道具 举报

6#
发表于 2010-9-4 14:33:45 | 只看该作者
我也来下下来试一下。
不知对我备份BCD菜单有没有帮助。
回复

使用道具 举报

7#
发表于 2010-9-4 15:18:37 | 只看该作者
支持一下,把复杂问题简单化。
回复

使用道具 举报

8#
发表于 2010-9-10 09:01:47 | 只看该作者
好帖!支持!化复杂为简单!
回复

使用道具 举报

9#
发表于 2010-9-23 23:32:08 | 只看该作者
这个很方便  

支持了
回复

使用道具 举报

10#
发表于 2012-9-6 14:48:27 | 只看该作者
好东东谢谢提供,收下了!
回复

使用道具 举报

11#
发表于 2012-9-11 12:06:48 | 只看该作者
这个要下来备用,谢谢楼主分享。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2025-7-25 22:47

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表