I have a bash script that is supposed to download a Windows 10 iso file from Microsoft and then change the names of two files in that iso in order to remove the "Press any key to boot from this CD/DVD..." prompt.

Essentially I just want to swap the file names of these two files:

enter image description here

So cdboot.efi becomes cdboot_noprompt.efi.
And cdboot_noprompt.efi becomes cdboot.efi.

I know I could mount the image, copy the the contents somewhere, modify it to my liking and then use mkisofs/genisoimage to create a new iso, somewhat like this:

sudo mount -o loop -t iso9660 /path/to/windows.iso /mnt
sudo cp /mnt/ /mnt_copy/
cd /mnt_copy/efi/microsoft/boot
sudo mv cdboot.efi tmp.efi
sudo mv cdboot_noprompt.efi cdboot.efi
sudo mv tmp.efi cdboot_noprompt.efi
sudo genisoimage -J -joliet-long -r -allow-lowercase -allow-multidot -o "/path/to/new/windows.iso" "/mnt_copy/"
# And then magically make the iso bootable again. No idea how this would be done.

but I'd like to avoid all this unnecessary overhead.

  • ISO images are read-only. Also, you say you already have a script for doing this? – Kusalananda Jul 18 at 9:55
  • You have to use special tools. Google "iso image editor" – FedonKadifeli Jul 18 at 9:57
  • @Kusalananda They may be read-only according to the specification, but maybe there is still a way to modify it. I mean you could definitely change arbitrary bytes inside of that file, so there must be some way, right? I have a bash script that downloads the windows 10 iso, but the script is not able to alter the iso file, that's why I'm asking. – Forivin Jul 18 at 10:44
  • Yes, you can change arbitrary bytes in the ISO data, but you can't change them arbitrarily. It would be akin to renaming a couple of files on a Linux disk by modifying the appropriate device file under /dev directly instead of using mv. Depending on the ISO file system, this may be more complicated than changing a couple of strings (one of which needs to be extended, which may overwrite data immediately following it). – Kusalananda Jul 18 at 10:48
  • @FedonKadifeli I couldn't find a tool that fits my needs. isomaster would be able to do it, but it can't be scripted with bash. – Forivin Jul 18 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.