|
@echo off
color 0a
title Bootmgr BCD Made By Cnstars, QQ:8202655
set BCDEDIT=bcdedit.exe
REM ★先用/create创建所有菜单入口,再用/set设置每个入口参数device, path的具体值,
REM ★最后用/displayorder将建好的每个入口(菜单项)一个一个加入到引导菜单中
REM ★其他还可以用/timeout 设置等待时间,以及用/default 设置缺省菜单。
REM ★1、新建名为 bcd(小写) 的启动配置文件
ECHO 安装前应先将BOOT目录及\BOOT.sdi等文件复制到目标磁盘分区!
ECHO.
pause 将覆盖原有的BCD引导菜单文件,按^C中止
REM %BCDEDIT% -createstore ..\Boot\bcd
set BCDEDIT=%BCDEDIT% -store ..\Boot\bcd
set RAMDISK_OPTIONS={ad6c7bc8-fa0f-11da-8ddf-0013200354d8}
Set LDR_GUID={522a486a-21e8-11de-994d-00e000f7c3cc}
set MGR_PEID={572bcd56-ffa7-11d9-aae0-0007e994107d}
set MBR_REID={891a4ae4-f386-11de-a3c7-005056c00008}
GOTO INIT
:START
set /P DRV=请输入文件WinRE.WIM已经复制的磁盘分区盘符(如:D,不要冒号):
IF "%DRV%"=="" set DRIVE=[boot] else set DRIVE=%DRV%:
IF EXIST %DRIVE%\MiniPE\WINRE.WIM GOTO INIT
ECHO 盘符设定错误!请重新输入!
GOTO START
IF "%SystemDrive%" == "C:" ECHO bootsect /nt60 c: /force /mbr
ECHO [LaunchApp] > %DRIVE%\windows\system32\winpeshl.ini
ECHO AppPath=x:\sources\recovery\recenv.exe >> %DRIVE%\windows\system32\winpeshl.ini
:INIT
%BCDEDIT% -delete {bootmgr} -f
%BCDEDIT% -delete {ntldr} -f
%BCDEDIT% -delete %LDR_GUID% -f
%BCDEDIT% -delete %MGR_PEID% -f
%BCDEDIT% -delete %RAMDISK_OPTIONS% -f
echo.
:CREATE
%BCDEDIT% -create %RAMDISK_OPTIONS% /d "Ramdisk Device" -device
%BCDEDIT% -create {ntldr} /d "WinNT PELoader"
%BCDEDIT% -create %MBR_REID% /d "BootSector Loader" -application bootsector
%BCDEDIT% -create %MGR_PEID% /d "BootMGR PELoader" -application OSLOADER
%BCDEDIT% -create {bootmgr} /d "Windows Boot Manager"
REM {bootmgr}bootsequence启动选择项目,winpe数值开机项目,nx为OptIn
REM partition系统引导分区,path系统引导文件,{default}默认,{current}当前
REM ★2、虚拟启动盘入口{ad6c7bc8-fa0f-11da-8ddf-0013200354d8}
REM Create Ramdisk device options for the boot.sdi file
%BCDEDIT% -set %RAMDISK_OPTIONS% ramdisksdidevice boot
%BCDEDIT% -set %RAMDISK_OPTIONS% ramdisksdipath \Boot.SDI
%BCDEDIT% -set {memdiag} path \boot\memtest.exe
%BCDEDIT% -set {memdiag} locale "zh-CN" >nul
REM ★3、老式操作系统入口(非application osloader)
%BCDEDIT% -set {ntldr} device boot
%BCDEDIT% -set {ntldr} path \WinNT.LDR >nul
%BCDEDIT% -set {ntldr} locale "zh-CN" >nul
%BCDEDIT% -set %MBR_REID% device boot
%BCDEDIT% -set %MBR_REID% path \GRLDR.MBR
REM ★4、Recovery Environment备份入口-partition=\Device\HarddiskVolume1
%BCDEDIT% -set %MGR_PEID% device boot
%BCDEDIT% -set %MGR_PEID% osdevice boot >nul
%BCDEDIT% -set %MGR_PEID% path \Windows\system32\boot\winload.exe >nul
%BCDEDIT% -set %MGR_PEID% device ramdisk=[boot]\MiniPE\WinRE.WIM,%RAMDISK_OPTIONS% >nul
%BCDEDIT% -set %MGR_PEID% osdevice ramdisk=[boot]\MiniPE\WinRE.WIM,%RAMDISK_OPTIONS% >nul
%BCDEDIT% -set %MGR_PEID% inherit {bootloadersettings} >nul
%BCDEDIT% -set %MGR_PEID% systemroot \Windows
%BCDEDIT% -set %Vista_GUID% locale "zh-CN" >nul
%BCDEDIT% -set %MGR_PEID% nx optin >nul
%BCDEDIT% -set %MGR_PEID% winpe yes >nul
%BCDEDIT% -set %MGR_PEID% detecthal yes >nul
%BCDEDIT% -set %MGR_PEID% custom:46000010 yes >nul
REM ★在Vista系统F8菜单中显示“修复计算机”
REM %BCDEDIT% -set {default} recoverysequence %MGR_PEID% >nul
REM %BCDEDIT% -set {default} recoveryenabled yes >nul
REM ★5、配置命令如下:
%BCDEDIT% -displayorder {ntldr} /addlast
%BCDEDIT% -displayorder %MGR_PEID% /addlast >nul
%BCDEDIT% -set {bootmgr} device boot
%BCDEDIT% -set {bootmgr} toolsdisplayorder {memdiag} >nul
%BCDEDIT% -set {bootmgr} inherit {globalsettings} >nul
%BCDEDIT% -set {bootmgr} locale "zh-CN" >nul
%BCDEDIT% -set {bootmgr} timeout 10 >nul
%BCDEDIT% -default %MGR_PEID%
@echo on
exit
图形界面工具,请参考:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=158247 |
-
-
bcdtool.rar
83.06 KB, 下载次数: 388, 下载积分: 无忧币 -2
BCD菜单命令配置
|