Recover Windows Boot Loader After a Fresh Linux Install

Well, my indecisiveness has come yet again to bite me in the rear, I decided to distrohop once more, and stupidly cleared my windows boot partition yet again (when will I ever learn). Well, this time since I've done it quite a number of times am an expert at recovering it, but incase I forget am noting it down here so that I can refer to it if need be.

So the steps are as follows:

  1. get a windows installation media
  2. plug the installation media into the pc and boot into it
  3. click trouble shoot
  4. click command prompt (may need to go into "advanced options" to find this)
  5. enter "bcdboot C:\windows"
  6. exit and reboot, windows should be back

If the above does not work, you need to do some screwing with the diskpart utility (although it is extremely trash compared to fdisk and other linux utilities, as expected)

  1. Follow same steps as above to get to command prompt
  2. enter diskpart
  3. type in list disk
  4. find the disk that matches your windows hard drive (to check you can enter select disk x and then list vol to show you the partitions of that drive)
  5. enter sel disk x
  6. once you find a disk select the small FAT32 partition that is on it (should be around 100MB)
  7.  enter sel vol x
  8. enter assign letter X:
  9. enter exit
  10. enter cd /d X:\efi\Microsoft\Boot\
  11. enter bootrec /FixBoot
  12. enter ren BCD BCD.backup
  13. enter bcdboot c:\Windows /l en-us /s x: /f ALL
  14. exit and reboot