How to change windows boot loader from linux ie via bash script

Dominiques007

New Member
Hello,

With EasyBCD we added 2 entry

1, Windows 10
2, live Linux auto test (DEFAULT)
The target is to run Linux, i.e., ubuntu on start, and after boot via a bash script, will restore / update BCD
bcdedit /import d:\Original.bcd

Result:
there will be only available on windows boot manager ONLY
1, Windows as default (only this option)
2, live Linux auto test WILL BE REMOVED completely

Thanks for your help and support !
 
To achieve your goal, you can create a bash script in Linux to modify the Windows Boot Loader configuration. Here's a high-level outline of the steps involved:

  1. Mount the Windows partition (usually C: drive) so you can access the Windows BCD store.
  2. Use chntpw or chntpw2 (NT Registry editor) to edit the BCD file. Make sure to install these tools if not already present.
  3. Locate the BCD store file, typically at C:\Boot\BCD, and edit it as needed. You can remove the Linux entry and set Windows as the default.
  4. Save the changes to the BCD store.
  5. Unmount the Windows partition.
 
Back
Top