Directly use bcdedit to create the bootmgr database and repair the Startup Menu

Source: Internet
Author: User

Directly use bcdedit to create the bootmgr database and repair the Startup Menu

Before using the following methods, you need the bcdedit and bootsect commands. These two commands can be obtained on the vista or windows 7 installation disc. The bootsect.exe file is in the bootdirectory of the vista and windows 7 installation optical disks, And the bcdedit.exe file can be obtained under the % windir % \ system32 directory on the computer where vista or windows 7 is installed, of course, you can also use the imagex command to mount the source \ install on the vista or windows 7 installation disc. wim file, and then the bcdedit command can be found under windows \ system32. For the imagex command, you can download the WAIK toolkit from Microsoft.


1. Create a BCD Database

Copy the boot folder and the bootmgr file on the CD to drive C, and then delete the C: \ Boot \ bcd file. Configure BCD storage in this step, use BCDEdit to create a STARTUP configuration file named BCD. Replace Boot. ini with BCD. BCDEdit is a command line tool designed to manage BCD storage. BCDEdit is available in both Windows PE and Windows Vista. For example, go to the directory where bcdedit is located and execute 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 // you can leave it unspecified. The default value 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 the Windows 7 Startup Menu

Bcdedit/create/d "Windows 7 Ultimate"-application osloader

After this command is complete, a GUID value is returned, such as: {faef23c1-6efe-11de-b779-b2c7bec45a2c}

The entry {uid} was successfully created.

Next, the GUID value {uid} indicates that it is 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 the Ubuntu9.04 boot menu

Download the grub4dos package, extract the grldr and grldr. mbr files, and copy them to the C root directory.

Bcdedit/create/d "grub menu"/application bootsector # create a startup Item named "grub menu" for the real-mode Start sector

Generate {ID} and copy it.

Bcdedit/set {ID} device partition = c: # set the partition where the Boot Sector file is located, where grldr. mbr is located

Bcdedit/set {ID} path \ grldr. mbr # specify the path and file name of the boot sector File

Bcdedit/displayorder {ID}/addlast # Add the Ubuntu menu item to the end.

Next, modify menu. lst.

Appendix: 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 start entry and time

Bcdedit/default {uid}

Bcdedit/timeout 7


7. Modify the startup parameter Mode

Bootsect/nt: (nt52 is started in ntldr mode, that is, XP boot menu mode; nt60 is the new bootmgr boot menu in VISTA .)

Use Bcdedit to create Linux boot

Use Bootmgr to boot Ubuntu (non-wubi installation)

Build bootmgr boot for Ubuntu

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.