#!/usr/bin/bash# Look up the boot number for Windows in the EFI recordsboot_number=$(echo $(efibootmgr) | grep -Po "(?<=Boot)\S{4}(?=( |\* )Windows)")# Check that Windows EFI entry was foundif [ -z "$boot_number" ]; thenkdialog --error "Cannot find Windows boot in EFI, exiting"exit 1fi# Set next boot to be Windows and reboot the machinesudo efibootmgr -n "${boot_number}" && reboot