From a45402e9d86794bcd636ee84c10d112f5c3d0854 Mon Sep 17 00:00:00 2001 From: CodingWonders <101426328+CodingWonders@users.noreply.github.com> Date: Fri, 22 Nov 2024 18:24:00 +0100 Subject: [PATCH] Set Boot Manager entry timeout to 0 Fixes #2562 --- functions/microwin/Microwin-NewFirstRun.ps1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/functions/microwin/Microwin-NewFirstRun.ps1 b/functions/microwin/Microwin-NewFirstRun.ps1 index 614df6bc..d6e5d4b7 100644 --- a/functions/microwin/Microwin-NewFirstRun.ps1 +++ b/functions/microwin/Microwin-NewFirstRun.ps1 @@ -63,6 +63,22 @@ function Microwin-NewFirstRun { { } + + # Get BCD entries and set bootmgr timeout accordingly + try + { + # Check if the number of occurrences of "path" is 2 - this fixes the Boot Manager screen issue (#2562) + if ((bcdedit | Select-String "path").Count -eq 2) + { + # Set bootmgr timeout to 0 + bcdedit /set `{bootmgr`} timeout 0 + } + } + catch + { + + } + '@ $firstRun | Out-File -FilePath "$env:temp\FirstStartup.ps1" -Force }