zoukankan      html  css  js  c++  java
  • 使用BCDEDIT创建BCD文件

    网上找了好久,总算找到一个完全的BCD文件编辑过程的代码,分享下:

    ###第1步################################################################################################################
    bcdedit /createstore c:ootcd
    ##创建一个记录文件123 (路径和文件名随便啦)
    ###第2步###############################################################################################################
    bcdedit /store c:ootcd /create {bootmgr} /d "Windows Boot Manager"
    ##创建主菜单入口ID
    bcdedit /store c:ootcd /set {bootmgr} device partition=c:
    ##设置主菜单引导程序所在分区
    bcdedit /store c:ootcd /timeout 5
    ##设置主菜单的显示时间30秒
    bcdedit /store c:ootcd /set {bootmgr} locale "zh-CN"
    ##设置主菜单的语言为中文
    ###第3步#################################################################################################################
    bcdedit /store c:ootcd /create /d "Microsoft Windows Vista" /application osloader
    ##添加Vista启动项ID
    ###第4步#############这里会生成一串数字ID,复制第3步生成的数字ID并替换下面的{数字Id},如果你还装Win2008的话就再多做一个第3步和第4步#######
    bcdedit /store c:ootcd /set {数字Id} device partition=c:
    ##设置Vista引导文件所在分区
    bcdedit /store c:ootcd /set {数字Id} path windowssystem32winload.exe
    ##设置Vista引导文件路径
    bcdedit /store c:ootcd /set {数字Id} osdevice partition=c:
    
    ##设置Vista所在分区
    bcdedit /store c:ootcd /set {数字Id} systemroot windows
    ##设置Vista所在文件夹
    bcdedit /store c:ootcd /set {数字Id} locale "zh-CN"
    ##设置Vista高级启动菜单的语言为中文
    bcdedit /store c:ootcd /displayorder {数字Id} /addfirst
    ##添加Vista到主菜单启动列表的最后一项(addlast是显示在顶部)
    bcdedit /store c:ootcd /default {数字Id}
    ##设置Vista操作系统为默认启动的系统, {legacy}是旧版本的Windows
    ###第5步################################################################################################################
    bcdedit /store c:ootcd /create {ntldr} /d "Microsoft Windows XP Professional"
    ##添加xp,2003启动项ID
    bcdedit /store c:ootcd /set {ntldr} device partition=d:
    ##设置xp,2003引导文件所在分区
    bcdedit /store c:ootcd /set {ntldr} path 
    tldr
    ##设置xp,2003引导文件路径(98,me,xp,200,2003是用ntldr启动的)
    bcdedit /store c:ootcd /displayorder {ntldr} /addfirst
    ##添加xp,2003到主菜单启动列表的最后一项(addlast是显示在底部)
    ###第6步################################################################################################################
    bcdedit /store c:ootcd /create {memdiag} /d "Windows 内存诊侧"
    ##添加windows内存诊侧启动项ID
    bcdedit /store c:ootcd /set {memdiag} device partition=c:
    ##设置windows内存诊侧引导文件所在分区
    bcdedit /store c:ootcd /set {memdiag} path ootmemtest.exe
    ##设置windows内存诊侧启动程序文件路径
    bcdedit /store c:ootcd /toolsdisplayorder {memdiag} /addlast
    ##添加windows内存诊侧到主菜单工具列表的最后一项(addfirst是显示在顶部)
    bcdedit /store c:ootcd /set {memdiag} locale "zh-CN"
    ##设置windows内存诊侧的语言为中文
    ###第7步#################################################################################################################
    bcdedit /export c:456
    ##备份原有的系统引导记录到 c:456
    bcdedit /import c:ootcd
    ##记录文件信息导入到系统引导记录
    bcdedit /enum all
    
    ##察看系统引导记录中的所有信息
    ###OK完成了!!##############################################################################################################

    创建完成后的效果:

    Windows 启动管理器
    --------------------
    标识符                  {bootmgr}
    device                  partition=C:
    description             Windows Boot Manager
    locale                  zh-cn
    default                 {default}
    displayorder            {default}
                            {ntldr}
    toolsdisplayorder       {memdiag}
    timeout                 5
    
    Windows 启动加载器
    -------------------
    标识符                  {default}
    device                  partition=C:
    path                    windowssystem32winload.exe
    description             Microsoft Windows Vista
    locale                  zh-cn
    osdevice                partition=C:
    systemroot              windows
    
    Windows 内存测试程序
    ---------------------
    标识符                  {memdiag}
    device                  partition=C:
    path                    ootmemtest.exe
    description             Windows Memory Diag
    locale                  zh-cn
    
    Windows 旧 OS 加载器
    ------------------------
    标识符                  {ntldr}
    device                  partition=D:
    path                    
    tldr
    description             Microsoft Windows XP

    启动入口最主要是四个部分:

    Identifier标识符——启动入口的系统标识,可能是bootmgr、current或id形式等。

    device设备——一般是驱动器路径或虚拟映像,系统启动引导后入口。

    path路径——是device设备的位置,系统用来定位启动文件。

    description描述——显示描述,也就是大家见到的菜单显示。

    {bootmgr} ——启动管理器
    {current}——当前操作系统,启动时选择的系统
    {default} ——缺省默认的启动项
    {ntldr} ——早期Windows加载

    转自:https://www.cnblogs.com/fatt/p/4397615.html

  • 相关阅读:
    布局重用 include merge ViewStub
    AS 常用插件 MD
    AS 2.0新功能 Instant Run
    AS .ignore插件 忽略文件
    AS Gradle构建工具与Android plugin插件【大全】
    如何开通www国际域名个人网站
    倒计时实现方案总结 Timer Handler
    AS 进行单元测试
    RxJava 设计理念 观察者模式 Observable lambdas MD
    retrofit okhttp RxJava bk Gson Lambda 综合示例【配置】
  • 原文地址:https://www.cnblogs.com/feiquan/p/10646439.html
Copyright © 2011-2022 走看看