Restoring a Windows boot entry

So you're messing around and delete the efi boot partition. After restarting you realise that you can't boot into Windows, so what do you do?

  1. Flash a Windows image onto a usb stick
  2. Boot into the live media
  3. Go to Repair your computer > Troubleshoot > Command Prompt
  4. We first need to make sure that the C drive is mounted:
    diskpart
    list volume
    # Figure out which volume is the C drive
    select volume X
    assign letter j
    exit
    
  5. Add the partition to the boot configuration
    bootrec /rebuildbcd