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- 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. 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. 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. 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.