Automatically fix bootmgfw.efi on Windows Update (script)

Hiya! When dual booting Windows and Hackintosh, one has to rename the Windows boot efi file so that the Clover boot file takes priority. However, every time Windows updates, this rename action is reversed, and once again Clover eats the dust.

I wrote a small script to be able to make this renaming process automated. The best part is that once set up, it works with all Windows updates!

This script runs in Windows, so all the setup is going to be in Windows.

This script first requires to have the EFI partition of your drive mounted as a drive letter in Windows. You can follow this guide using MiniTool Partition Wizard to do that. I mounted my EFI partition to E:. Whatever drive letter you use matters, as the script is going to need to know and mount that partition using that drive letter.

Once the EFI partition is setup, now you're ready to get the script running. First download the script from my GitHub gist. The .bat file should be placed somewhere that you can remember. I'd recommend somewhere in your Documents folder. Second, edit the script and change the drive letter to the letter you used for your EFI partition. Essentially, replace the line that is just E: with your letter (don't forget the colon!). Third, test the script by running it via CMD (by double clicking the .bat file). If you have your EFI partition open via MiniTool, you can see how the Windows bootmgfw.efi in EFI\Microsoft\Boot is now named bootmgfw-orig.efi.

Fun fact, I have the script rotate the .efi file once. But, I have the file extension as .txt so that the boot loader doesn't mistake the backup as an actual boot file.

Once the .bat is ensured to be working, lets get it to run after a Windows update! Follow the steps from this StackExchange answer to get the file to run after each update. Remember to select your neatly placed .bat file! It's also good practice to give the task a related name, and description!

Tahdah! I hope it works for y'all! Let me know if there is any issues!

submitted by /u/zardini123
[link] [comments]