Bcdedit fixes Windows 7 startup

Source: Internet
Author: User

The XP Startup File contains three ntldr, ntdetect. com, Boot. ini, where ntldr is the startup ID and the boot guide file of XP, and boot. INI is the startup configuration file;

 

Windows 7 is a little different,

Bootmgr: Boot manager for the Windows nt6 series, located in the active primary partition, which is a system hidden file

Bootsect. Bak: bootsect. Bak is the backup file of the first 16 sectors of the active partition. Therefore, it is 8 kb in size, which is the backup of PBR.

/Boot/[language]/bootmgr.exe. Mui: bootmgr. EXE. Mui in 24 languages under the boot directory of the primary partition, which is used to form a boot menu in combination with bootmgr
/Boot/BCD: it is equivalent to the boot. ini in the XP era. However, BCD is based on databases, not text, but also for security considerations. Microsoft provides a BCD modification program bcdeit to modify the corresponding parameters.
/Boot/BCD. log & BCD. log1 & BCD. log2: log file. What is the specific cause? Unknown.
/Boot/bootstat. DAT: The data file used to record the boot status during boot.
/Boot/memtest.exe: memory testing tool

 

 

Next, let's take a look at how to edit bcdedit's article on repairing reverse dual-system installation.

 

 

Bcdedit.exe is a command line tool that comes with Vista to customize windows Boot manager, which is located in the V:/Windows/system32 directory. Bcdedit.exe is powerful and has many parameters. tools such as vistabootpro and easybcd are graphical bcdedit tools which can implement bcdedit. In a few situations, the tools cannot achieve the purpose, while bcdedit.exe can be handy. For this reason, you must understand the built-in command line tool bcdedit.exe. Bcdedit.exe has many parameters, and the help documentation is very complicated. Many people discard it. But in fact, most people only need to know a few of its usage.

Next, I use a notebook to explain common functions of bcdedit.exe.

One secret: bcdedit can not only
Data), it can also operate on the file BCD. As a newbie, you should not rashly change your system BCD (which may cause you to lose the boot menu or even fail to start your computer ). Therefore, in the following example, I only operate on one file BCD, and then import the file BCD to the system BCD. The operations on the file BCD and the system BCD are exactly the same (in fact, the system BCD is also a file, you can use bcdedit to view the C:/boot/BCD content)

Operating Environment: XP is installed on disk C, Vista is installed on disk D, and XP on disk C is reloaded again. Therefore, the original boot menu is lost. Now, you can only boot XP. For convenience, I copied D:/Windows/system32/bcdedit.exe to C:/, and changed the current path to C:/In the CMD window :/. The expected BCD information should be like this.
Windows boot Manager
--------------------
Identifier: {bootmgr} // This Is Not A menu, but a main portal. a bcd has only one {bootmgr}
Type: 10100002
Device: partition = C: // does this indicate that the BCD information of the Boot manager is stored on the drive C?
Description: Wolf Boot manager
Display order: {ntldr} // The Order of menu items. The first menu item
{882e394a-f543-11db-8ee8-00105ccdeb8f} // The second menu item
Windows legacy OS loader
------------------------
Identifier: {ntldr} // XP it uses the ntldr program for guidance
Type: 10300006
Device: partition = C: // XP on drive C
Path:/ntldr // The bootstrap is/ntldr
Description: Wolf XP // text displayed in the menu
Windows boot loader
-------------------
Identifier: {882e394a-f543-11db-8ee8-00105ccdeb8f}
// This string of numbers is generated by the computer and is unique.
Type: 10200003
Device: partition = D: // Vista on disk D
Path:/Windows/system32/winload.exe
// The Vista boot program is/Windows/system32/winload.exe
Description: Wolf Vista // text displayed in the menu
Windows Device: partition = D:
Windows root:/Windows
In a simple explanation, there are only three entries above, and each entry is subdivided. The most important thing is identifier, which many people cannot understand.
In BCD, the unique identifier of each entry is the identifier (ID ).
There are three IDs:
{Bootmgr}
{Ntldr}
{882e394a-f543-11db-8ee8-00105ccdeb8f}
To modify the generated entry, you must specify its ID. The changes are made for specific IDS.
In the above three IDs, the first two are not the last one but also composed of a large number? This is also the reason why beginners are most likely to misunderstand.
I can only tell you that {bootmgr} and {ntldr} are actually reserved IDs, where {bootmgr} is a reasonable ID required in BCD, the {ntldr} ID is used to store the boot menu information of old XP systems.
Next we will generate the above BCD information step by step.
Since we do not have a file BCD, we need to create one first. The command is as follows:
Bcdedit/createstore bcdwolf
This command creates an empty BCD file C:/bcdwolf. With this empty BCD file, we will operate on it.
C:/bcdedit/store c:/bcdwolf/create {ntldr}/D "Wolf XP"
Note: If this store parameter is not added after bcdedit, the BCD operation is performed on the system. If this parameter is added, the BCD operation is performed on the specified file.
The preceding command creates the menu wolf XP in the BCD information of the C:/bcdwolf file.
/Store parameters refer to operations on C:/bcdwolf, rather than system BCD
The/create parameter indicates creating a new menu.
{Ntldr} is a fixed ID. All Operating System menus before Vista Use this ID. If you need to create a menu item that can guide XP, use this ID, you cannot specify it as another one or make the computer generate a random ID for you like the Vista menu.
The/d parameter specifies the text displayed in the menu.
C:/bcdedit/store c:/bcdwolf/create/D "Wolf Vista"/Application osloader
The entry {882e394a-f543-11db-8ee8-00105ccdeb8f} was successfully created.
Create menu wolf Vista
Because it is a menu of the Vista system, the parameter is changed to/Application osloader.
In Vista and Vista systems, the menu creation method is different.
C:/bcdedit/store c:/bcdwolf/create {bootmgr}/D "Wolf Boot manager"
The entry {bootmgr} was successfully created.
Create the {bootmgr} portal. This is the main portal, not the menu. All the menus created are managed in this portal.
C:/bcdedit/store c:/bcdwolf/Enum all
Show the created C:/bcdwolf content
Windows boot Manager
--------------------
Identifier: {bootmgr}
Type: 10100002
Description: Wolf Boot manager
Windows boot loader
-------------------
Identifier: {882e394a-f543-11db-8ee8-00105ccdeb8f}
Type: 10200003
Description: Wolf Vista
Windows legacy OS loader
------------------------
Identifier: {ntldr}
Type: 10300006
Description: Wolf XP
Set the device value of the {bootmgr} entry
C:/bcdedit/store c:/bcdwolf/set {bootmgr} device partition = C:
The operation is successful.
Set the device value of the {ntldr} entry, which is actually the partition where XP is located.
C:/bcdedit/store c:/bcdwolf/set {ntldr} device partition = C:
The operation is successful.
Set the PATH value of the {ntldr} entry. Here, specify the path of the boot program. XP is in C:/ntldr.
C:/bcdedit/store c:/bcdwolf/set {ntldr} path/ntldr
The operation is successful.
Set the device value of the {882e394a-f543-11db-8ee8-00105ccdeb8f} entry.
Note: {882e394a-f543-11db-8ee8-00105ccdeb8f} is the global ID of the menu "Wolf Vista". This ID is automatically generated, and Vista is on disk D.
C:/bcdedit/store c:/bcdwolf/set {882e394a-f543-11db-8ee8-00105ccdeb8f} device partition = D:
The operation is successful.
Set the PATH value of the {882e394a-f543-11db-8ee8-00105ccdeb8f} entry in D:/Windows/system32/winload.exe
C:/bcdedit/store c:/bcdwolf/set {882e394a-f543-11db-8ee8-00105ccdeb8f}
Path/Windows/system32/winload.exe
The operation is successful.
Append the menu with ID {ntldr} to the end of multiple menus.
C:/bcdedit/store c:/bcdwolf/displayorder {ntldr}/addlast
The operation is successful.
Append the menu (Wolf Vista) with ID {882e394a-f543-11db-8ee8-00105ccdeb8f} to the end of multiple menus.
C:/bcdedit/store c:/bcdwolf/displayorder
{882e394a-f543-11db-8ee8-00105ccdeb8f}/addlast
The operation is successful.
Set {882e394a-f543-11db-8ee8-00105ccdeb8f} to drive D for Windows Device
C:/bcdedit/store c:/bcdwolf/set {882e394a-f543-11db-8ee8-00105ccdeb8f}
Osdevice partition = D:
The operation is successful.
Set {882e394a-f543-11db-8ee8-00105ccdeb8f}'s windows root to/Windows
C:/bcdedit/store c:/bcdwolf/set {882e394a-f543-11db-8ee8-00105ccdeb8f}
SYSTEMROOT/Windows
The operation is successful.
View results
C:/bcdedit/store c:/bcdwolf
Windows boot Manager
--------------------
Identifier: {bootmgr}
Type: 10100002
Device: partition = C:
Description: Wolf Boot manager
Display order: {ntldr}
{882e394a-f543-11db-8ee8-00105ccdeb8f}
Windows legacy OS loader
------------------------
Identifier: {ntldr}
Type: 10300006
Device: partition = C:
Path:/ntldr
Description: Wolf XP
Windows boot loader
-------------------
Identifier: {882e394a-f543-11db-8ee8-00105ccdeb8f}
Type: 10200003
Device: partition = D:
Path:/Windows/system32/winload.exe
Description: Wolf Vista
Windows Device: partition = D:
Windows root:/Windows
Add another content and set the wait time to 30 seconds.
C:/bcdedit/store c:/bcdwolf/timeout 30
The operation is successful.
Set {882e394a-f543-11db-8ee8-00105ccdeb8f} to the default menu
C:/bcdedit/store c:/bcdwolf/default {882e394a-f543-11db-8ee8-00105ccdeb8f}
The operation is successful.
Finally, let's take a look.
C:/bcdedit/store c:/bcdwolf
Windows boot Manager
--------------------
Identifier: {bootmgr}
Type: 10100002
Device: partition = C:
Description: Wolf Boot manager
Default: {default}
Display order: {ntldr}
{Default}
Timeout: 30
Windows legacy OS loader
------------------------
Identifier: {ntldr}
Type: 10300006
Device: partition = C:
Path:/ntldr
Description: Wolf XP
Windows boot loader
-------------------
Identifier: {default}
Type: 10200003
Device: partition = D:
Path:/Windows/system32/winload.exe
Description: Wolf Vista
Windows Device: partition = D:
Windows root:/Windows
========================================================
You can import the file BCD to the system BCD.
Bcdedit/import C:/bcdwolf
You can also back up the system BCD to a file
Bcdedit/export E:/bcdbak

======================================
The entire process is as follows:
Create 3 entries with/create
Use/set to set the specific values under each entry, such as device and path.
Finally, use/displayorder to add each created entry (menu item) to the boot menu one by one.
You can also use/timeout to set the wait time.
And use/default to set the default menu
The "entry" in the above operation is actually represented by the ID in curly brackets.

========================================
After the system BCD is set, restart the computer, and there is no guarantee that multiple boot operations are successful. BCD depends on the C:/boot folder and C:/bootmgr file to work. C:/bootmgr is the real boot program, and the C:/boot folder contains a file named BCD (you can use bcdedit
/Store c:/boot/BCD/Enum all view content), and a font sub-folder containing a font file, which is probably used to display the boot menu.

 

This article comes from:

Http://blog.sina.com.cn/s/blog_63a5b36a0100fwpq.html

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.