ONLY FOR UEFI GPT BOOT DISKS!

I cloned a Surface Pro 1st gen hdd to a USB drive to transfer to a Surface Book and Windows would not boot. I tried the following commands to repair the boot partition:

bootrec /fixmbr (this completed successfully)
bootrec /fixboot (this said Access Denied)
bootrec /rebuildbcd (this said Element not found)
  • You can also try (this finally worked for me after trying a lot of things on one occasion):
bcdboot C:\windows

What I finally did that worked was this on a separate occasion:

  • diskpart
  • list disk
  • select disk 0
  • list partition
  • select partition 1 (your system partition)
  • detail partition (EFI partition ID is C12A7328-F81F-11D2-BA4B-00A0C93EC93B)
  • delete partition override
  • create partition efi size=100 (Change the size to fit)
  • create partition msr size=128 (Change the size to fit)

After doing that process I ran the bootrec commands from the first part of this post and all completed successfully. Windows now boots.

If that still does not work then try this:

Boot a UEFI USB stick with Windows 10 (Also works with server 2019 and Hyper-V 2019) and go through the wizard to install windows

I selected the partition with my data and got an error stating the current windows folder will be renamed windows.old

Continue past that error and then as soon as it is done copying system files click the X to cancel the installation (You may be able to even unplug the computer at that moment if you want.)

DON’T LET IT CONTINUE INSTALLATION CANCEL IT AFTER THE FIRST STEP IN THE INSTALLATION PROGRESS WINDOW! Clicking the X worked for me.

Once done try the bootrec and bcdboot commands above

Reference:
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc725927(v=ws.11)
https://www.tenforums.com/tutorials/95941-diskpart-how-partition-gpt-disk.html
http://woshub.com/how-to-repair-deleted-efi-partition-in-windows-7/
http://woshub.com/how-to-rebuild-bcd-file-in-windows-10/
https://www.dell.com/support/article/us/en/04/sln300987/how-to-repair-the-efi-bootloader-on-a-gpt-hdd-for-windows-7-8-8-1-and-10-on-your-dell-pc?lang=en