From ddbf2b0339e07e0ba487324908c8c5fa30c6bf4b Mon Sep 17 00:00:00 2001 From: Zehadi Alam <63765084+zehadialam@users.noreply.github.com> Date: Thu, 5 Sep 2024 17:57:35 -0400 Subject: [PATCH] Use bcdedit to set Windows Boot Manager and default Windows boot loader to be first in the display order of UEFI firmware --- FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 b/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 index 34f1f9d..070000d 100644 --- a/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 +++ b/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 @@ -554,6 +554,12 @@ If (Test-Path -Path $Drivers) WriteLog 'Copying drivers succeeded' } +WriteLog "Setting Windows Boot Manager to be first in the display order." +Invoke-Process bcdedit.exe "/set {fwbootmgr} displayorder {bootmgr} /addfirst" +WriteLog "Windows Boot Manager has been set to be first in the display order." +WriteLog "Setting default Windows boot loader to be first in the display order." +Invoke-Process bcdedit.exe "/set {bootmgr} displayorder {default} /addfirst" +WriteLog "The default Windows boot loader has been set to be first in the display order." #Copy DISM log to USBDrive WriteLog "Copying dism log to $USBDrive" invoke-process xcopy "X:\Windows\logs\dism\dism.log $USBDrive /Y"