如果您收到错误消息 -尝试复制引导文件时失败(Failure when attempting to copy boot files),那么这篇文章可能会帮助您解决问题。BCDBoot是一个命令行实用程序,用于配置启动文件,因此当您打开计算机时,它知道从哪里启动或Windows所在的位置。该工具还用于修复系统分区或修复启动菜单,还可以将计算机设置为从虚拟硬盘启动。
尝试复制引导文件时失败
已知有多种解决问题的方法,有时问题可能是由于UEFI或BIOS差异造成的。确保有人知道如何在计算机上进行技术管理 -
- 将分区设置为活动
- 检查您是否有 BIOS 或 UEFI
- 修复 MBR 或重建它
这里的场景是您尝试将引导文件复制到主硬盘驱动器上的活动分区或尝试在USB闪存驱动器或分区上创建引导条目。这样做,它是失败的。如果还有其他原因导致问题,那么使用修复命令是更好的选择。
1]将分区设置为活动
将复制文件的分区必须处于活动状态。当计算机启动时,它首先寻找一个活动分区,然后定位启动文件。使用以下命令使用 diskpart 工具将分区设置为活动分区。为USB驱动器执行此命令时,您可以从 Advanced Recovery或Windows本身使用此命令。(Windows)
diskpart
select disk 0
list partition
select partition Z
active
exit
执行 list partition 命令时,请记下安装Windows的分区号。在上面的命令中,Z 是Windows可用的分区。然后执行 bcdboot 命令复制文件。
2]检查您是否有BIOS或UEFI
很多事情取决于您是否拥有 UEFI 或 BIOS。当您启动到高级恢复时,该命令默认设置为使用它。因此,如果您启动进入BIOS但在命令中提及UEFI,则会导致上述错误。
我们很多人只是简单地复制命令并运行它,但这些都是重要的小事。因此,如果有混淆,并且您不确定计算机是UEFI还是Legacy,请使用以下命令。
bcdboot c:\windows /s Z: /f ALL
这里 Z 是系统分区的卷号,必须使用 /s。选项 /f 用于固件类型。如果您确定,您可以使用BIOS或EFI 。
3] 修复 MBR 并重建 BCD
如果您突然面临这种情况,并且您只打开笔记本电脑什么也没做,那么它可能是需要修复的引导记录。您可以修复 MBR(fix the MBR)和Rebuild BCD来解决问题。这可以通过使用 Windows 10 可启动媒体启动到高级恢复来完成。
在高级恢复(Advanced Recovery)中,选择Troubleshoot > Advanced > Command Prompt。并依次执行以下。它将自我修复,并让Windows正常启动。
bootrec /fixmbr
bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcd
我们还会建议备份 MBR(backup MBR)或创建 系统恢复盘。(System Recovery Disk.)如果发生类似情况,您不必运行Windows 恢复磁盘(Windows Recovery Disk)。要在Windows(Windows)中创建系统恢复驱动器,请搜索“ RecoveryDrive.exe ” 并按照向导进行操作。
MBR Backup & HDHacker 是两个免费软件,可以帮助您备份和恢复MBR & Boot Sector。
我希望这篇文章很容易理解,并且您能够通过错误消息解决问题。
Failure when attempting to copy boot files on Windows 11/10
If you receive an error message – Failure when attempting to copy boot files, then this post may be able to help you fix the problem. BCDBoot is a command-line utility that is used to configure boot files, so when you turn on the computer, it knows where to boot from or where Windows is located. The tool is also used to repair system partition or repair boot menu and also set up a computer to boot from a virtual hard disk.
Failure when attempting to copy boot files
There are known multiple ways to fix the problem, and sometimes the problem could be because of UEFI or BIOS difference. Make sure this is followed by someone who knows how to manage things technically on the computer-
- Set Partition as Active
- Check if you have BIOS or UEFI
- Fix MBR or Rebuild it
The scenario here is that you are trying to copy the boot files to either the active partition on the primary hard drive or trying to create boot entries on a USB flash drive or a partition. Doing that, it is failing. If there is anything else that is causing the problem, then using the repair command is a better option.
1] Set Partition as Active
The partition on which the file will be copied has to be active. When the computer starts, it first looks for an active partition and then locates the boot files. Use the following command to set the partition as active using the diskpart tool. You can use this command from Advanced Recovery or from Windows itself when doing it for a USB drive.
diskpart
select disk 0
list partition
select partition Z
active
exit
When you execute the list partition command, note the partition number where Windows is installed. In the above command, Z is the partition where the Windows is available. Then execute the bcdboot command to copy the files.
2] Check if you have BIOS or UEFI
A lot of things depend on whether you have UEFI or BIOS. When you boot into advanced recovery, the command is by default set to work with it. So if you boot into BIOS but are mentioning UEFI in the command, then it will result in the said error.
A lot of us simply copy the command and run it, but these are minor things that are important. So if there is confusion, and you are not sure if the computer, i.e., UEFI or Legacy, use the following command.
bcdboot c:\windows /s Z: /f ALL
Here Z is the volume letter of the system partition, and /s has to be used for that. The option /f is for firmware type. You can use BIOS or EFI if you are sure.
3] Fix MBR and Rebuild BCD
If you are facing this all of a sudden, and you did nothing but turned on the laptop, then its probably the boot record that needs a fix. You can fix the MBR and Rebuild BCD to fix the problem. This can be done by booting into the advanced recovery using a Windows 10 Bootable media.
When in Advanced Recovery, choose to Troubleshoot > Advanced > Command Prompt. And execute the following one after the other. It will self-repair, and let Windows boot normally.
bootrec /fixmbr
bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcd
We will also suggest to backup MBR or creates a System Recovery Disk. In case something similar happens, you don’t have to run for the Windows Recovery Disk. To create a system recovery drive in Windows, search for “RecoveryDrive.exe” and follow the wizard.
MBR Backup & HDHacker are two freeware that can help you backup and restore the MBR & Boot Sector.
I hope the post was easy to follow, and you were able to resolve the problem with an error message.