2012 R2 Boot Repair - Windows Server

sfc /scannow /offbootdir=D:\ /offwindir=D:\Windows (Replace D: with your OS drive letter.)

From Command Prompt:

bcdedit /export C:\BCD_Backup attrib C:\boot\bcd -s -h -r ren C:\boot\bcd bcd.old bootrec /rebuildbcd (Replace C: with your system reserved partition – often a small 350MB partition without a drive letter. Use diskpart → list volume → select volume X → assign letter=S: → exit then S: for the commands above.) If your server uses BIOS (not UEFI) and you see "Operating system not found": windows server 2012 r2 boot repair