If you want to add an UEFI entry for Ubuntu with bcdedit, you can use the following commands as administrator:
List all BCD entries for UEFI:
bcdedit /enum firmware
Copy UEFI entry of "Windows Boot Manager" to create a new entry for Ubuntu:
bcdedit /copy {bootmgr} /d "Ubuntu Secure Boot"
Set file path for the new Ubuntu entry. Replace {guid} with the returned GUID of the previous command.
bcdedit /set {guid} path \EFI\UBUNTU2\WUBILDR\SHIMX64.EFI
Set optionally Ubuntu as first entry in the boot sequence. Replace {guid} with the returned GUID of the copy command.
bcdedit /set {fwbootmgr} displayorder {guid} /addfirst
Alternatively, you can use a script which does the job for you:
@ECHO OFF rem add Ubuntu EFI entry bcdedit /enum firmware for /f "tokens=2 delims={}" %%a in ('bcdedit /copy {bootmgr} /d "Ubuntu Secure Boot"') do set guid={%%a} bcdedit /set %guid% path \EFI\UBUNTU2\WUBILDR\SHIMX64.EFI bcdedit /set {fwbootmgr} displayorder %guid% /addfirst bcdedit /enum firmware
bcdedit
真實模式開機磁區
---------------------
identifier {cb89e314-cd72-11ea-bd00-f8e4e3a51d69}
device partition=C:
path \grldr.mbr
description Start Grub4dos
C:\WINDOWS\system32>bcdedit /delete {cb89e314-cd72-11ea-bd00-f8e4e3a51d69}
操作順利完成。