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 sucessfully)

bootrec /fixboot (This said Access Denied)

bootrec /rebuildbcd (this said Element not found)

What I finally did that worked was this:

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

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