Windows boot order file

BCDBoot Command-Line Options

BCDBoot is a command-line tool used to configure the boot files on a PC or device to run the Windows operating system. You can use the tool in the following scenarios:

  • Add boot files to a PC after applying a new Windows image. In a typical image-based Windows deployment, use BCDBoot to set up the firmware and system partition to boot to your image. To learn more, see Capture and Apply Windows, System, and Recovery Partitions.
  • Set up the PC to boot to a virtual hard disk (VHD) file that includes a Windows image. To learn more, see Boot to VHD (Native Boot): Add a Virtual Hard Disk to the Boot Menu.
  • Repair the system partition. If the system partition has been corrupted, you can use BCDBoot to recreate the system partition files by using new copies of these files from the Windows partition.
  • Set up or repair the boot menu on a dual-boot PC. If you’ve installed more than one copy of Windows on a PC, you can use BCDBoot to add or repair the boot menu.

File Locations

In Windows and Windows Preinstallation Environment (WinPE)

In the Windows Assessment and Deployment Kit (WindowsВ ADK):

C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\BCDBoot\BCDBoot.exe

Supported operating systems

BCDBoot can copy boot environment files from images of WindowsВ 10, Windows 8.1, WindowsВ 8, WindowsВ 7, WindowsВ Vista, Windows ServerВ 2016 Technical Preview, WindowsВ Server 2012 R2, Windows ServerВ 2012, Windows ServerВ 2008В R2, or WindowsВ ServerВ 2008.

How It Works

To configure the system partition, BCDBoot copies a small set of boot-environment files from the installed Windows image to the system partition.

BCDBoot can create a Boot Configuration Data (BCD) store on the system partition using the latest version of the Windows files:

  • BCDBoot creates a new BCD store and initialize the BCD boot-environment files on the system partition, including the Windows Boot Manager, using the %WINDIR%\System32\Config\BCD-Template file.
  • New in WindowsВ 10: During an upgrade, BCDBoot preserves any other existing boot entries, such as debugsettings, when creating the new store. Use the /c option to ignore the old settings and start fresh with a new BCD store.
  • If there is already a boot entry for this Windows partition, by default, BCDBoot erases the old boot entry and its values. Use the /m option to retain the values from an existing boot entry when you update the system files.
  • By default, BCDBoot moves the boot entry for the selected Windows partition to the top of the Windows Boot Manager boot order. Use the /d option to preserve the existing boot order.

On UEFI PCs, BCDBoot can update the firmware entries in the device’s NVRAM:

  • BCDBoot adds a firmware entry in the NVRAM to point to the Windows Boot Manager. By default, this entry is placed as the first item in the boot list. Use the /p option to preserve the existing UEFI boot order. Use /addlast to add it to the bottom of the boot order list.

Command-Line Options

The following command-line options are available for BCDBoot.exe.

BCDBOOT [/l ] [/s [/f ]] [/v] [/m [<OS Loader GUID>]] [/addlast or /p] [/d] [/c]

Required. Specifies the location of the Windows directory to use as the source for copying boot-environment files.

The following example initializes the system partition by using BCD files from the C:\Windows folder:

Optional. Specifies the locale. The default is US English ( en-us ).

The following example sets the default BCD locale to Japanese:

Optional. Specifies the volume letter of the system partition. This option should not be used in typical deployment scenarios.

Use this setting to specify a system partition when you are configuring a drive that will be booted on another computer, such as a USB flash drive or a secondary hard drive.

UEFI:

BCDBoot copies the boot files to either the EFI system partition, or the partition specified by the /s option.

BCDBoot creates the BCD store in the same partition.

By default, BCDBoot creates a Windows Boot Manager entry in the NVRAM on the firmware to identify the boot files on the system partition. If the /s option is used, then this entry is not created. Instead, BCDBoot relies on the default firmware settings to identify the boot files on the system partition. By the UEFI 2.3.1 spec, the default firmware settings should open the file: \efi\boot\bootx64.efi in the EFI System Partition (ESP).

BIOS:

BCDBoot copies the boot files to either the active partition on the primary hard drive, or the partition specified by the /s option.

BCDBoot creates the BCD store in the same partition.

The following example copies BCD files from the C:\Windows folder to a system partition on a secondary hard drive that will be booted on another computer. The system partition on the secondary drive was assigned the volume letter S:

The following example creates boot entries on a USB flash drive with the volume letter S, including boot files to support either a UEFI-based or a BIOS-based computer:

Optional. Specifies the firmware type. Valid values include UEFI , BIOS , and ALL .

On BIOS/MBR-based systems, the default value is BIOS . This option creates the \Boot directory on the system partition and copies all required boot-environment files to this directory.

On UEFI/GPT-based systems, the default value is UEFI . This option creates the \Efi\Microsoft\Boot directory and copies all required boot-environment files to this directory.

When you specify the ALL value, BCDBoot creates both the \Boot and the \Efi\Microsoft\Boot directories, and copies all required boot-environment files for BIOS and UEFI to these directories.

If you specify the /f option, you must also specify the /s option to identify the volume letter of the system partition.

The following example copies BCD files that support booting on either a UEFI-based or a BIOS-based computer from the C:\Windows folder to a USB flash drive that was assigned the volume letter S:

Optional. Enables verbose mode. Example:

Optional. Merges the values from an existing boot entry into a new boot entry.

By default, this option merges only global objects. If you specify an OS Loader GUID, this option merges the loader object in the system template to produce a bootable entry.

The following example merges the operating-system loader in the current BCD store that the specified GUID identifies in the new BCD store:

Optional. Specifies that the Windows Boot Manager firmware entry should be added last. The default behavior is to add it first. Cannot be used with /p.

Optional. Specifies that the existing Windows Boot Manager firmware entry position should be preserved in the UEFI boot order. If entry does not exist, a new entry is added in the first position. Cannot be used with /addlast.

By default, during an upgrade BCDBoot moves the Windows Boot Manager to be the first entry in the UEFI boot order.

Optional. Preserves the existing default operating system entry in the object in Windows Boot Manager.

Optional. Specifies that any existing BCD elements should not be migrated.

New for WindowsВ 10: By default, during an upgrade, BCD elements such as debugsettings or flightsigning are preserved.

Repair the system partition

If the system partition has been corrupted, you can use BCDBoot to recreate the system partition files by using new copies of these files from the Windows partition.

Boot your PC to a command line. For example, boot to the Windows installation disk and press Shift+F10, or boot to Windows PE (WinPE: Create USB Bootable drive).

Use Diskpart to determine which drive letter contains your Windows partition and system partition ( diskpart, list vol, exit ).

Optional: Format your system partition: format (drive letter of your system partition) /q

Add a boot entry for your Windows partition: bcdboot D:\Windows

Reboot the PC. Windows should appear.

Set up or repair the boot menu on a dual-boot PC

When setting up a PC to boot more than one operating system, you may sometimes lose the ability to boot into one of the operating systems. The BCDBoot option allows you to quickly add boot options for a Windows-based operating system. To set up a dual-boot PC:

Install a separate hard drive or prepare a separate partition for each operating system.

Install the operating systems. For example, if your PC has WindowsВ 7, install WindowsВ 10 onto the other hard drive or partition.

Reboot the PC. The boot menus should appear with both operating systems listed.

If both operating systems aren’t listed:

Open a command line, either as an administrator from inside Windows, or by booting to a command line using the Windows installation media and pressing Shift+F10, or by booting to Windows PE (WinPE: Create USB Bootable drive).

Add boot options for a Windows operating system.

Reboot the PC. Now, the boot menu will show both menu options.

Troubleshooting

For information about repairing the boot files on a PC with Windows XP and a more recent version of Windows such as WindowsВ 7, see the Microsoft Knowledge Base Article 2277998.

What Is a Boot File?

The word «boot» has different meanings in different contexts. You might be dealing with a file that uses the .BOOT file extension or maybe you’re looking for information on when your computer boots up, like the different types of boot up options and how to use bootable files and programs.

How to Open .BOOT Files

Files that end with the .BOOT suffix are InstallShield files. These are plain text files that store installation settings for the InstallShield program, which is an application that’s used for creating setup files for software installs.

Since they’re text files, you can most likely view the contents with a text editor, like Notepad in Windows or an application from our Best Free Text Editors list.

These kinds of BOOT files are sometimes seen stored along with similar installation files like INI and EXE files.

What Are Bootable Files?

Bootable files have nothing to do with files that end in the .BOOT file extension and that are used by InstallShield. Instead, they’re simply files that have been configured to run when the computers boots up. That is, before the operating system has loaded.

However, there are two types that we need to cover. One set are the files Windows requires in order to boot successfully, that are stored on the hard drive. The other are the bootable files that are stored on other devices that run before the operating system starts.

Windows Boot Files

When the Windows OS is first installed, certain files are placed on the hard drive that are required to be there in order for the operating system to load, whether in Normal Mode or Safe Mode.

For example, Windows XP requires that NTLDR, among other files, be loaded from the volume boot record before the OS can start. Newer versions of Windows need BOOTMGR, Winload.exe, and others.

When one or more of these boot files are missing, it’s common to have a hiccup during startup, where you normally see some kind of error related to the missing file, like «BOOTMGR is missing.»

See this page for a more comprehensive listing of the boot files required to start different versions of Windows.

Other Kinds of Boot Files

Under normal conditions, a computer is configured to boot to a hard drive that stores the operating system, like Windows. When the computer first boots up, the proper boot files mentioned above are read and the operating system can load from the drive.

From there, you can open regular, non-bootable files like your images, documents, videos, etc. Those files can be opened as usual with their related programs, like Microsoft Word for DOCX files, VLC for MP4s, etc.

However, in some circumstances, it’s necessary to boot to a device other than the hard drive, like a flash drive or CD. When the boot sequence is properly changed, and the device is configured to be booted from, you can consider those files «bootable files» since they run at boot time.

This is necessary when doing things like reinstalling Windows from a disc or flash drive, running bootable antivirus software, testing the computer’s memory, partitioning the hard drive with tools like GParted, wiping all the data from the HDD, or any other task that involves manipulating or reading from the hard drive without actually booting to it.

For example, AVG Rescue CD is an ISO file that needs to be installed to a disc. Once there, you can change the boot order in BIOS to boot to the optical disc drive instead of the hard drive. What happens next is that instead of the computer looking for boot files on the hard drive, it looks for boot files on the disc, and then loads what it finds; AVG Rescue CD, in this case.

To reiterate the difference between boot files and regular computer files, consider that you could install a different AVG program, like the AVG AntiVirus desktop version, onto your computer’s hard drive. To run it, you’d need to change the boot order to launch the hard drive’s operating system. Once the computer boots to the hard drive and loads the OS, you’d be able to open AVG AntiVirus but not AVG Rescue CD.

Восстановление загрузчика Windows 10: ручное пересоздание файла конфигурация загрузки BCD

Диспетчер загрузки современных версий Windows использует для загрузки операционных систем, установленных на компьютере, файл BCD (Boot Configuratin Data) , в котором хранятся данные об ОС и параметрах их загрузки. В том случае, если файл BCD удален или поврежден, Windows перестает загружаться. В этой статье мы покажем способ ручного пересоздания файла хранилища данных конфигурации загрузки на примере Windows 10.

В том случае, если файл BCD поврежден или отсутствует, скорее всего, при попытке загрузить Windows, пользователь увидит такое сообщение:

Your PC needs to be repaired
The Boot Configuration Data file is missing some required information
File: \Boot\BCD
Error code: 0xc0000034

При появлении такой ошибки, в первую очередь попытайтесь исправить проблему с загрузкой ОС с помощью режима Startup Repair , который можно запустить из среды восстановления Windows RE .

Совет . Желательно периодически проверять работоспособность среды WinRE, и если она не работает, воспользоваться для ее восстановления методикой из статьи Восстановление среды WinRE в Windows 10.

В том случае, если автоматическое восстановление с помощью Startup Repair не помогло решить проблему, необходимо загрузиться с загрузочного / установочного диска с Windows или в среде WinRe (Repair your computer -> Troubleshoot -> Advanced options -> Command Prompt), запустить командную строку и попытаться создать новый файл конфигурации BCD «с нуля».

Очень важно . Все инструкции, описанные ниже, подходят для обычных MBR+BIOS систем. На системах с UEFI для пересоздания BCD нужно воспользоваться следующими инструкциями по восстановлению загрузчика в Windows 10/8 c EFI или Windows 7 .

В этом примере я буду использовать установочный диск с Windows 10. Загрузившись с него, нужно нажать на экране выбора языка сочетание клавиш Shift+F10 .

Попробуйте восстановить BCD файл автоматически, выполнив команду:

Перезагрузите компьютер и проверьте, загружается ли Windows, если нет, опять загрузитесь с установочного диска и откройте окно командной строки. Нам нужно идентифицировать диски системы (скорее всего назначенные им буквы дисков будут отличаться от дисков, которые вы видели при работе в Windows). Проще всего это сделать с помощью утилиты diskpart. Выполните следующие команды:

Перед вами появится список разделов в системе, назначенные им буквы и их размер. В нашем случае, на диске имеются всего два раздела:

  • Раздел System Reserved размером 500 Мб, которому назначена буква диска C: . На этом небольшом служебном разделе по-умолчанию хранится файл конфигурации загрузки BCD ( подробнее )
  • NTFS раздел размером 39 Гб, которому назначена буква D:. На этом разделе находится Window и данные пользователя

Важно . Запомните назначенные буквы дисков, т.к. в они будут использоваться в последующих командах.

С помощью следующих команд мы добьемся того, чтобы в MBR и загрузочном секторе имелись нужные ссылки на загрузчик Windows (bootloader).

bootrec.exe /fixmbr
bootsect.exe /nt60 all /force

Совет . Если команда bootsect.exe не будет найдена, попробуйте указать путь
X:\boot\bootsect.exe /nt60 all /force

Далее с помощью команды BCDedit создадим новый файл с конфигурацией загрузки (предполагается, что у вас нет резервной копии BCD ).

Удалите старый (поврежденный) файл BCD на разделе System Reserved и создайте вместо него новый.
del c:\boot\bcd

Создайте временный пустой файл bcd.tmp
bcdedit /createstore c:\boot\bcd.tmp

Создайте запись для диспетчера загрузки bootmgr.
bcdedit.exe /store c:\boot\bcd.tmp /create /d «Windows Boot Manager»

Импортируйте в BCD настройки из файла bcd.tmp
bcdedit.exe /import c:\boot\bcd.tmp

Укажите, что загрузчик находится на служебном разделе System Reserved (ему назначена буква диска C: )
bcdedit.exe /set device partition=c:

Настройте время ожидания при выборе ОС
bcdedit.exe /timeout 10

Удалите временный файл
del c:\boot\bcd.tmp

Итак, у нас имеется пустой файл с параметрами загрузчика. Теперь в него нужно добавить записи об имеющихся на компьютере ОС. Создадим в хранилище BCD новую запись для Windows 10 bcdedit.exe /create /d «Windows 10» /application osloader

Команда должна вернуть уникальный идентификатор (GUID) данной записи загрузчика.
The entry <8a7f03d0-5338-11e7-b495-c7fffbb9ccfs>was successfully created.

Укажем, что bootmgr должен использовать данную запись по-умолчанию (после истечения времени ожидания для загрузки используется именно эта запись).

Теперь в новой записи загрузчика осталось указать пути к имеющейся на диске установленной копии Windows (ранее мы определении, что в среде WinPe диску с Windows присвоена буква D: )

bcdedit.exe /set device partition=d:
bcdedit.exe /set osdevice partition=d:
bcdedit.exe /set path \Windows\system32\winload.exe
bcdedit.exe /set systemroot \Windows
Осталось сделать данную запись видимой (по умолчанию она скрыта)
bcdedit.exe /displayorder /addlast

Итак, мы полностью пересоздали хранилище конфигурации загрузки. Теперь можно перезагрузить компьютер и убедится, что Windows 10 загружается в штатном режиме.

Читайте также:  Install windows from bios usb
Оцените статью
Option Description