Managing Startup Items

Source: Internet
Author: User
Tags command line ini backup

In a previously NT-based Windows system, Windows uses NTLDR as the boot loader to boot the system-the so-called boot loader, a small program that is executed before the operating system kernel is run, through which the system initializes hardware devices, Set up the map of memory space and so on, put the software and hardware environment of the system into a suitable state, prepare the correct environment for the final call to the operating system kernel. -During startup, Ntldr uses the Boot.ini file to determine which operating system options to display during boot/boot, and our settings for startup options can be implemented by modifying the corresponding content in the Boot.ini file.

In Vista and Windows7, Microsoft introduced a new boot loader architecture, Windows boot Manager (Bootmgr.exe). Unlike Ntldr, which relies heavily on hardware, the new architecture in Vista and WINDOWS7 enables complete hardware independence and seamless integration with a variety of operating systems, making Windows Vista boot/boot processes faster and more secure. Also, transfer the content managed by Boot.ini in the previous Windows system to the new boot Configuration data (BCD: Startup settings), and of course, the new startup options Editing Tool, BCDEdit (BCDEdit.exe), To manage startup settings.

Bcdedit:vista and Windows 7 startup settings Editing Tool

In a traditional BIOS-based computer, if only Vista and Windows 7 are installed, you will find that Boot.ini files are completely removed from the system, in addition to the very early Vista and Windows 7 beta versions; if Vista and Windows are installed in the system Windows XP 7 and earlier, while still finding Boot.ini files, will only work on those systems without any impact on Vista and Windows 7 startup.

In computers based on EFI (Extensible firmware Interface: Extensible Firmware Interface, and more PCs with this interface later), Boot.ini files are even more non-existent, and in the EFI based system, startup options are stored in the motherboard's memory. To modify the startup options, either through a tool that can read and write nvram, such as Nvrboot, or by using the bcdedit mentioned above.

This shows that in Vista and Windows 7, want to be like before Windows In XP, a simple text editor to modify Boot.ini to manage startup options is no longer possible, and to modify the startup settings, you can only use the command format in a much more complex bcdedit.

In addition, Microsoft also provides a BCD class that can be invoked via WMI (Windows Management instrumentation:windows Management specification) in Vista and Windows7, and it can programmatically modify the BCD data, but It is believed that this is a more impossible task for the vast majority of users.

Start bcdedit

Note that Bcdedit is not a program that runs under a graphical interface, but rather a command-line tool that is located in the "\Windows\System32" directory.

To perform bcdedit, you should first go to the Command Line window, and you want to move the user and elevate to administrator privileges. In the Command Line window, enter "Bcdedit".

Introduction to the Bcdedit command

With command-line tools Bcdedit, we can add, delete, and modify objects in the BCD (Boot Configuration Data). In BCD, each object has a unique GUID (globally unique Identifier: Globally unique identifier), such as each hard disk in the system, and the GUID (globally unique identifier) for each partition.

In BCD, the GUID of a hard disk or partition can be grouped into the following categories:

{legacy}: Refers to a hard disk or partition that has a previous generation of Windows systems such as Windows XP;

{default}: Hard disk or partition on which the default operating system resides;

{Current}: Active hard disk or partition;

{C34b751a-ff09-11d9-9e6e-0030482375e7}: A GUID similar to this format refers to other hard disks or partitions that have an operating system installed.

(Note: This is just an example where the specific numbers vary according to the hard disk or partition parameters, but are similar to the {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} format).

bcdedit command

bcdedit/? : Show Command Help

Bcdedit.exe/? CreateStore: Displays the details of the command parameter "CreateStore"--of course, "CreateStore" is just an example, and you can use a similar format for any of the other available parameters to see a specific description of the parameter.

Bcdedit or Bcdedit/enum All: Displays the current startup settings data for Vista and Windows 7 systems, when all the hard drives or partitions that have the operating system installed on the system display the corresponding GUID IDs, such as { XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.

Use bcdedit backup and Restore startup options

Before you modify the startup options for Vista and Windows 7, it is a good idea to back them up, just in case of an error or other failure that causes the system to fail to start.

Bcdedit/export "D:\BCD backup\bcd Backup": Back up the startup settings to the "BCD backup" directory in D disk;

Bcdedit/import "D:\BCD backup\bcd Backup": Back up the boot option in the D disk "BCD Backup" directory before restoring.

Use Bcdedit to modify Startup menu options

As a good practice, before you make any changes to Vista and Windows 7 startup options, you should first back up the startup options in BCD, and the corresponding commands we've covered in the previous page, and then use the "bcdedit" or "Bcdedit/enum" All to view the correct GUID identification of the hard disk or partition in the system and record it. After all, Bcdedit is just a command-line tool, and we need to manually enter long strings such as "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" when we operate, which can easily go wrong, which often leads to Vista and Windows 7 failed to start.

The following is a detailed description of the common command format for using Bcdedit to modify startup options:

Bcdedit/set {legacy} Description "Windows XP Professional SP2": Modify the display of the previous operating system in the boot menu, for example, we can also modify it to "Vista dedicated XP SP2" and so on. Note that the quotation marks in the command are not omitted;

Bcdedit/set {Current} description Vista and Windows 7 build 5270 X86″: Modify the display of the operating system in the Startup menu on the currently boot hard disk or partition. Note that the operating system on the current partition may be Vista and Windows 7, or other systems, and of course the quotes in the command cannot be omitted;

Bcdedit/set {5189b25c-5558-4bf2-bca4-289b11bd29e2} description "Vista and Windows 7 build 5270 x64": Modify the display of a system installed on another hard disk or partition in the Startup menu, be sure to note that the hard drive/partition GUID is entered correctly, and the corresponding GUID can be viewed through the "bcdedit" or "Bcdedit/enum all" commands.

Bcdedit/default {Current}: Sets the operating system in the currently boot hard disk/partition to the default boot system;

Bcdedit/default {5189B25C-5558-4BF2-BCA4-289B11BD29E2}: Sets the system that the operating system on the specified GUID is started by default;

Bcdedit/default {Legacy}: Sets the system that Windows XP for the previous generation of Windows system started by default;

Bcdedit/displayorder: Sets the order in which items are displayed in the enabled menu, such as:

Bcdedit.exe/displayorder {legacy} {current}

Windows XP is displayed first, and then the default boot system, such as Vista and Windows7, is displayed.

Bcdedit/timeout 15: Change the default boot menu to 30 seconds to 15 seconds, and of course, you can change this time to any value you want.

Use bcdedit to repair hard disk/partition structure errors

During the modification of startup options, such as adding or removing a hard drive/partition, the hard drive/partition structure may be confused by the careless operation, in addition to the backup method before restoring modifications, you can first use bcdedit to try the fix.

The specific methods are as follows:

X:\>x:\boot\fixntfs.exe-lh-all: At this time "X:" refers to boot directory "boot" on the hard disk/partition;

Bcdedit/set {5189b25c-5558-4bf2-bca4-289b11bd29e2} device Partition=x:: Sets the partition of the specified GUID as the boot partition. Note that the GUID for "X:" Here is different than the specified value, and that the following Osdevice command must be run after the command is run;

Bcdedit/set {5189b25c-5558-4bf2-bca4-289b11bd29e2} osdevice partition=x:: Sets the partition of the specified GUID as the boot partition. Note that this command must be paired with the device command above, and that the GUID for "X:" should be different from the specified value.

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.