diskpart (opens Disk Partitioning tool)
select disk 0
list volume (please note the number of the volume that has no drive letter assigned and has FAT32 listed in Fs column)
select volume <the number of ~500 MB FAT32 volume with no drive letter, or with label ESP>
assign letter=Z: (gives drive letter Z: to EFI System Partition)
exit (closes Disk Partitioning tool)
cd /d Z:\EFI\Microsoft\Boot\ (changes current folder in Command Prompt window)
attrib Z:\EFI\Microsoft\Boot\BCD -h -r -s (removes hidden, read-only and system attributes from BCD folder)
ren Z:\EFI\Microsoft\Boot\BCD BCD.old (renames BCD folder to BCD.old)
bootrec /rebuildbcd (retries the rebuild)