Create BOOTMGR database and repair boot menu directly with Bcdedit

Source: Internet
Author: User

Create BOOTMGR database and repair boot menu directly with Bcdedit

The Bcdedit and bootsect two commands are required before using the following method, which can be obtained on Vista or on the Windows 7 installation CD. The Bootsect.exe file is available in the boot directory of the installation CD for Vista and Windows 7, while the Bcdedit.exe file can be obtained in the%windir%\system32 directory on a computer that has a Vista system or Windows 7 system installed. Of course, you can also use the ImageX command to mount the Source\install.wim file in Vista or the Windows 7 installation CD, and then you can find the Bcdedit command under Windows\System32. As for the ImageX command can be downloaded to Microsoft Official Waik Toolkit.

1. Create a BCD database

Copy the Boot folder and the Bootmgr file on the installation CD to drive C, and then delete the C:\Boot\bcd file. Configure the BCD store in this step, use BCDEdit to create a new startup configuration file named BCD. BCD replaces the boot. ini. BCDEdit is a command-line tool designed to manage the BCD store. BCDEdit is available in both Windows PE and Windows Vista. For example, enter the directory where bcdedit executes the following command:

Bcdedit/createstore C:\BCD

Bcdedit/import C:\BCD

bcdedit/create {bootmgr}/d "Boot Manager"

Bcdedit/set {bootmgr} device boot

Bcdedit/set {bootmgr} locale en-us//Can not be set, default is English

2. Add the Windows XP boot menu:

bcdedit/create {ntldr}/d "Windows XP Professional"

Bcdedit/set {ntldr} path \ntldr

Bcdedit/set {ntldr} device Partition=c:

Bcdedit/displayorder {ntldr}-addlast

3. Add Windows 7 boot Menu

bcdedit/create/d "Windows 7 Ultimate"-application OSLoader

A GUID value is returned when this command is finished, such as: {FAEF23C1-6EFE-11DE-B779-B2C7BEC45A2C}

The entry {UID} was successfully created.

Next {UID} This GUID value represents a menu item for Windows 7.

Bcdedit/set {UID} osdevice partition=e:

Bcdedit/set {UID} device partition=e:

Bcdedit/set {UID} path \windows\system32\winload.exe

Bcdedit/set {uid} systemroot \ Windows

Bcdedit/displayorder {UID}-addlast

4. Add PE 1.0 Boot Menu

bcdedit/copy {ntldr}/d "Windows PE"

The entry {UID} was successfully

Bcdedit/set {UID} path \ldrxpe

Bcdedit/set {UID} device Partition=c:

Bcdedit/displayorder {UID}-addlast

5. Add Ubuntu9.04 boot Menu

Download Grub4dos software package, extract files Grldr and grldr.mbr Copy to C packing directory

bcdedit/create/d "Grub Menu"/application bootsector #建立一个名称为 "Grub Menu", startup entry for real mode boot sector

Generate {ID} copy down

Bcdedit/set {ID} device partition=c: #设置引导扇区文件所在的分区, GRLDR.MBR partition

Bcdedit/set {ID} path \grldr.mbr #指定引导扇区文件的路径和文件名

Bcdedit/displayorder {ID}/addlast #增加这个Ubuntu的菜单项到末尾.

The following changes menu.lst, just fine.

Attached: my Ubuntu9.04 menu.lst

Title Ubuntu 9.04, kernel 2.6.28-12-generic

Root ()/ubuntu/disks

Kernel/boot/vmlinuz-2.6.28-12-generic root=uuid=2414a33a14a30dbc loop=/ubuntu/disks/root.disk ro quiet Splash

Initrd/boot/initrd.img-2.6.28-12-generic

6. Set the default startup entry and select Time

Bcdedit/default {UID}

Bcdedit/timeout 7

7. Modify the start parameter mode

Bootsect/nt: (Nt52 is started with NTLDR mode, that is, XP boot Menu mode, NT60 is the use of the new Vista bootmgr boot menu. )

This article is from the Linux commune website (www.linuxidc.com) Source Link: http://www.linuxidc.com/Linux/2013-11/92756.htm

Create BOOTMGR database and repair boot menu directly with Bcdedit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.