Windows 10 boot loader repair

In the last 10 days, I came up with two similar cases of laptops being suddenly unable to boot. It appeared that the boot loader was corrupted, making them unable to boot into Windows 10.

They both displayed the following error message:

Your PC needs to be repaired
File: \Boot\BCD
Error code: 0xc0000034

So, the first step to fixing it is to get a bootable Windows 10 Setup USB (or DVD) from Microsoft.

Next, boot the computer from this USB (or DVD), select Repair your computer click on Troubleshoot and then on Command Prompt.

Once there, you can try the following commands:

Bootrec /fixmbr
Bootrec /fixboot
Bootrec /scanos
Bootrec /rebuildbcd

In my case however, the last command failed with the error: The requested system device cannot be found

So, after some more digging I ended up doing the following that solved the problem

Still in the command prompt, enter:
diskpart

Select the PC Hard drive:
sel disk 0

List the Volumes on that disk:
list vol

Find the EFI Volume. It’s the one formated as FAT32 with a size of 100 to 200MB. Note it’s volume number to use it in the next command. In my case it was the #2.

Select the EFI Volume:
sel vol 2

Assign a drive letter to it:
assign letter=b:

Exit Diskpart:
exit

Next run the following commands:

cd /d b:\EFI\Microsoft\Boot\
bootrec /fixboot
ren BCD BCD.bak
bcdboot c:\Windows /s b: /f ALL

Reboot and you should be OK.

Source:
https://superuser.com/questions/460762/how-can-i-repair-the-windows-8-efi-bootloader