Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Remove the Message Press any key to boot from CD or DVD

August 14, 2024
in A, Blog, Windows 10, Windows 11
4
ADVERTISEMENT

Table of Contents

Remove the Message Press any key to boot

When using OSD ISO files to deploy the operating system to multiple virtual machines without manual intervention, the recurring prompt “Press any key to boot from CD or DVD” became bothersome. Unfortunately, there is no way to bypass this prompt through a parameter or option.

NyDHimRexKZPHngGu7peyrmveAdMy3qQSLYWZ88WvI3oHeoHk6qaVRF0G4Nq

And this is especially frustrating since in SCCM, when you follow the Create Task Sequence Media wizard, you actually have an option to “Allow unattended operating system deployment.” This eliminates indeed all prompts from SCCM, but the initial prompt to boot from the media is still there and if you do not press “that” key, it does not boot from the device by default, even if you put it on the first position in the boot order.

The online research leads me quickly to the solution for the BIOS architecture. There is a file (\ISO\Boot\bootfix.bin) that you can delete and then everything is fine. Of course, you need to create the bootable ISO file again and for this you need a tool such as AnyBurn. And, of course, you need to do something else for the UEFI architecture.

hNuJJ1yOd5vQ32F4AlavTL5zkEZEXNRdAQtmNZETGz59TyKw98QanXXbgIQG

After taking a closer look at how the The Windows Assessment and Deployment Kit (Windows ADK) is creating the bootable iso files and correlated this with vague information from the Internet regarding the UEFI part of the issue, we found a quick and nice solution. Let’s get started.

Remove the Message Press any key to Boot from CD or DVD

1. Before you begin, ensure you’ve installed The Windows Assessment and Deployment Kit (Windows ADK). You can install it manually or you can simply open Windows PowerShell (Terminal) as administrator, then the below command.

irm bonguides.com/adk/dpt | iex

2. We just need to install the Deployment Tools instead of installing all tools. Once then, we can move forward to the next step to create a custom ISO image.

RpWKpK9hIEJIG2AJgkKrOFGbL73zbbBPTRGZVMOCEwjdTYDaOdiknubdwdVy

3. Run the below command in an elevated PowerShell session:

irm bonguides.com/adk/rmbootfix | iex

Alternatively, you can also copy the code below and create your PowerShell script on your computer. Then, execute it manually.

$SourceISOPath = Read-Host -Prompt "Path to the source ISO file"
$UnattendedISOPath = Read-Host -Prompt "Path to the destination ISO file"

# First we make sure that ADK 10 is installed on the local computer and we get its location
$ADKProduct = $null
$ADKProduct = Get-WmiObject -Class Win32_Product | Where {$_.Name -eq "Windows Deployment Tools"}
if ($ADKProduct -ne $null) {
# Now getting the installation folder; we should have a registry key
if (!(Test-Path -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows Kits\Installed Roots")) {
Write-Host -ForegroundColor Yellow "The ADK 10 application has been detected on the current computer, but the installation folder not. Aborting..."
exit
}
else {
# actual installation folder detection
$Props = Get-ItemProperty -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows Kits\Installed Roots"
$ADKPath = $Props.KitsRoot10
Write-Host -ForegroundColor Green "The ADK 10 application has been detected on the current computer."
}
}
else {
Write-Host -ForegroundColor Yellow "The ADK 10 application is not detected as installed on the current computer. Aborting..."
exit
}

# Then we start processing the source ISO file
$SourceISOFullPath = ($SourceISOPath).trim('"')
try {
Mount-DiskImage -ImagePath $SourceISOFullPath
}
catch {
Write-Host -ForegroundColor Yellow 'An error occured while mounting the source ISO file. It may be corrupt. Aborting...'
exit
}
$iSOImage = Get-DiskImage -ImagePath $SourceISOFullPath | Get-Volume
$iSODrive = "$([string]$iSOImage.DriveLetter):"

# Test if we have enough memory on the current Windows drive to perform the operation (twice the size of the IS0)
$ISOItem = Get-Item -Path $SourceISOFullPath
$SystemDrive = Get-WmiObject Win32_LogicalDisk -filter "deviceid=""$env:SystemDrive"""

if (($ISOItem.Length * 2) -le $SystemDrive.FreeSpace) {
Write-Host -ForegroundColor Green "The current system drive appears to have enough free space for the ISO conversion process."
}
else {
Write-Host -ForegroundColor Yellow "The current system drive does not appear to have enough free space for the ISO conversion process. Aborting..."
exit
}

# Process the ISO content using a temporary folder on the local system drive
if (!(Test-Path -Path "$env:TEMP\sourceisotemp" -PathType Container)) {
New-Item -Path "$env:TEMP\sourceisotemp" -ItemType Directory -Force | Out-Null
}
else {
Remove-Item -Path "$env:TEMP\sourceisotemp" -Force -Confirm:$false
New-Item -Path "$env:TEMP\sourceisotemp" -ItemType Directory -Force | Out-Null
}

Write-Host -ForegroundColor Green "Extracting the content of the ISO file."
Get-ChildItem -Path $iSODrive | Copy-Item -Destination "$env:TEMP\sourceisotemp" -Recurse -Container -Force
Write-Host -ForegroundColor Green "The content of the ISO file has been extracted."

# Processing the extracted content
if (Test-Path -Path "$env:TEMP\sourceisotemp\boot\bootfix.bin" -PathType Leaf) {
Remove-Item -Path "$env:TEMP\sourceisotemp\boot\bootfix.bin" -Force -Confirm:$false
}
$oscdimg = $ADKPath + "Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe"
$etfsboot = $ADKPath + "Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\etfsboot.com"
$efisys_noprompt = $ADKPath + "Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\efisys_noprompt.bin"
$parameters = "-bootdata:2#p0,e,b""$etfsboot""#pEF,e,b""$efisys_noprompt"" -u1 -udfver102 ""$env:TEMP\sourceisotemp"" ""$UnattendedISOPath"""

$ProcessingResult = Start-Process -FilePath $oscdimg -ArgumentList $parameters -Wait -NoNewWindow -PassThru

if ($ProcessingResult.ExitCode -ne 0) {
Write-Host -ForegroundColor Yellow "There was an error while creating the iso file."
}
else {
Write-Host -ForegroundColor Green "The content of the ISO has been repackaged in the new ISO file."
}

# Cleaning up
Remove-Item -Path "$env:TEMP\sourceisotemp" -Force -Recurse -Confirm:$false
Write-Host -ForegroundColor Green "The temp folder has been removed."

# Dismount the ISO file as we no longer require it
Dismount-DiskImage -ImagePath $SourceISOFullPath
Write-Host -ForegroundColor Green "The source ISO file has been unmounted."
$SourceISOPath = Read-Host -Prompt "Path to the source ISO file"
$UnattendedISOPath = Read-Host -Prompt "Path to the destination ISO file"

# First we make sure that ADK 10 is installed on the local computer and we get its location
$ADKProduct = $null
$ADKProduct = Get-WmiObject -Class Win32_Product | Where {$_.Name -eq "Windows Deployment Tools"}
if ($ADKProduct -ne $null) {
# Now getting the installation folder; we should have a registry key
if (!(Test-Path -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows Kits\Installed Roots")) {
Write-Host -ForegroundColor Yellow "The ADK 10 application has been detected on the current computer, but the installation folder not. Aborting..."
exit
}
else {
# actual installation folder detection
$Props = Get-ItemProperty -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows Kits\Installed Roots"
$ADKPath = $Props.KitsRoot10
Write-Host -ForegroundColor Green "The ADK 10 application has been detected on the current computer."
}
}
else {
Write-Host -ForegroundColor Yellow "The ADK 10 application is not detected as installed on the current computer. Aborting..."
exit
}

# Then we start processing the source ISO file
$SourceISOFullPath = ($SourceISOPath).trim('"')
try {
Mount-DiskImage -ImagePath $SourceISOFullPath
}
catch {
Write-Host -ForegroundColor Yellow 'An error occured while mounting the source ISO file. It may be corrupt. Aborting...'
exit
}
$iSOImage = Get-DiskImage -ImagePath $SourceISOFullPath | Get-Volume
$iSODrive = "$([string]$iSOImage.DriveLetter):"

# Test if we have enough memory on the current Windows drive to perform the operation (twice the size of the IS0)
$ISOItem = Get-Item -Path $SourceISOFullPath
$SystemDrive = Get-WmiObject Win32_LogicalDisk -filter "deviceid=""$env:SystemDrive"""

if (($ISOItem.Length * 2) -le $SystemDrive.FreeSpace) {
Write-Host -ForegroundColor Green "The current system drive appears to have enough free space for the ISO conversion process."
}
else {
Write-Host -ForegroundColor Yellow "The current system drive does not appear to have enough free space for the ISO conversion process. Aborting..."
exit
}

# Process the ISO content using a temporary folder on the local system drive
if (!(Test-Path -Path "$env:TEMP\sourceisotemp" -PathType Container)) {
New-Item -Path "$env:TEMP\sourceisotemp" -ItemType Directory -Force | Out-Null
}
else {
Remove-Item -Path "$env:TEMP\sourceisotemp" -Force -Confirm:$false
New-Item -Path "$env:TEMP\sourceisotemp" -ItemType Directory -Force | Out-Null
}

Write-Host -ForegroundColor Green "Extracting the content of the ISO file."
Get-ChildItem -Path $iSODrive | Copy-Item -Destination "$env:TEMP\sourceisotemp" -Recurse -Container -Force
Write-Host -ForegroundColor Green "The content of the ISO file has been extracted."

# Processing the extracted content
if (Test-Path -Path "$env:TEMP\sourceisotemp\boot\bootfix.bin" -PathType Leaf) {
Remove-Item -Path "$env:TEMP\sourceisotemp\boot\bootfix.bin" -Force -Confirm:$false
}
$oscdimg = $ADKPath + "Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe"
$etfsboot = $ADKPath + "Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\etfsboot.com"
$efisys_noprompt = $ADKPath + "Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\efisys_noprompt.bin"
$parameters = "-bootdata:2#p0,e,b""$etfsboot""#pEF,e,b""$efisys_noprompt"" -u1 -udfver102 ""$env:TEMP\sourceisotemp"" ""$UnattendedISOPath"""

$ProcessingResult = Start-Process -FilePath $oscdimg -ArgumentList $parameters -Wait -NoNewWindow -PassThru

if ($ProcessingResult.ExitCode -ne 0) {
Write-Host -ForegroundColor Yellow "There was an error while creating the iso file."
}
else {
Write-Host -ForegroundColor Green "The content of the ISO has been repackaged in the new ISO file."
}

# Cleaning up
Remove-Item -Path "$env:TEMP\sourceisotemp" -Force -Recurse -Confirm:$false
Write-Host -ForegroundColor Green "The temp folder has been removed."

# Dismount the ISO file as we no longer require it
Dismount-DiskImage -ImagePath $SourceISOFullPath
Write-Host -ForegroundColor Green "The source ISO file has been unmounted."

4. When the script runs, you need to enter the path of your original ISO file and the destination ISO as needed. That’s all you need to do. The script does the rest automatically.

# Output
PS C:\> irm bonguides.com/adk/rmbootfix | iex

Path to the source ISO file: "D:\ISOs\Windows11.iso"
Path to the destination ISO file: "D:\ISOs\Windows11Custom.iso"

It could take several minutes to complete. Please ensure that your disk has at least 15GB of free space.

The ADK 10 application has been detected on the current computer.

Attached          : True
BlockSize         : 0
DevicePath        : \\.\CDROM1
FileSize          : 5557432320
ImagePath         : D:\ISOs\Windows11.iso
LogicalSectorSize : 2048
Number            : 1
Size              : 5557432320
StorageType       : 1
PSComputerName    :

The current system drive appears to have enough free space for the ISO conversion process.
Extracting the content of the ISO file.
The content of the ISO file has been extracted.

OSCDIMG 2.56 CD-ROM and DVD-ROM Premastering Utility
Copyright (C) Microsoft, 1993-2012. All rights reserved.
Licensed only for producing Microsoft authorized content.
Scanning source tree (500 files in 43 directories)
Scanning source tree complete (944 files in 86 directories)
Computing directory information complete
Image file is 5555322880 bytes
Writing 944 files in 86 directories to D:\ISOs\Windows11Custom.iso
100% complete

Final image file is 5557428224 bytes
Done.
The content of the ISO has been repackaged in the new ISO file.
The temp folder has been removed.
Attached          : True
BlockSize         : 0
DevicePath        : \\.\CDROM2
FileSize          : 5557432320
ImagePath         : D:\ISOs\Windows11.iso
LogicalSectorSize : 2048
Number            : 2
Size              : 5557432320
StorageType       : 1
PSComputerName    :

The source ISO file has been unmounted.

5. Please ensure that the ISO image has been created in the specified destination location.

uuukZnGG8Ezv4C6i8jQYIB4x6f6VjpTgDv0Lz7pWkwFUYXH67KVqwWCQZVCT

6. Finally, edit the virtual machine (VM) settings to boot from the custom ISO image file. The message “Press any key to boot from CD or DVD” should no longer appear, and you will go directly to the Windows installation screen.

ADVERTISEMENT

Not a reader? Watch this related video tutorial:

5/5 - (2 votes)
Previous Post

Missing While or Until Keyword in Do Loop PowerShell

Next Post

Import-Csv Cannot Find Drive, A Drive with the Name ‘”C’ Does not Exist

Related Posts

Images Hidden Due To Mature Content Settings In CivitAI

August 31, 2024

Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

August 20, 2024

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024

How to Remove The Test Mode Watermark Without Disabling Test Mode

July 28, 2024

Comments 4

  1. Mohammad Faizan says:
    2 years ago

    Excellent work. It worked smoothly.

    Reply
    • bon says:
      2 years ago

      Thanks for your feedback.

      Reply
  2. Matthew says:
    8 months ago

    I am not sure if this still works.

    I just tried this on a VM. Original ISO works and I can press any key and the ISO boots. But after creating the custom ISO. I now get UEFI Boot Error.

    https://imgur.com/qEiLzPw

    Reply
    • bon says:
      8 months ago

      Change the boot order of the VM.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory