Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Whenever Windows self-repairs the bootloader it makes me want to learn DOS.


Learn the modern equivalent, the CMD console.

You really want the Administrative Command Prompt for best functionality.

However, remember if using Powershell instead it's still having trouble with the curly brackets so in every case they need to be quoted in commands, such as this example:

Bcdedit /set "{default}" Description "Win11 23H2 on Dell 512gb SSD part 2"

Which gives a much more useful description than the plain "Windows 11" that exists already on installations otherwise. Even though these "descriptions" never display until there are more than one choice on the bootmenu.

Concentrate on the commands, BCDEDIT, BCDBOOT, and familiarize with DISKPART which opens its own sub-shell to handle drives. When you are done with Diskpart, you have to type "exit" to go back to the regular command line,

Inbuilt Help docs for the regular command prompt are obtained the same old DOS way, for example "bcdedit /?".

As an example, Bcdedit is too complex to learn from the Help messages, and there are hidden sub-help "chapters" which add to the confusion, so learn this one from the internet and its expert examples.

OTOH Bcdboot is straightforward, but either way, to access a particular (naturally hidden) EFI folder (other than the one you are booted from at the time) on a chosen HDD or SSD you would first have to make the volume visible by giving it an alphabetic designator using Diskpart, the ASSIGN command.

Under Diskpart, ASSIGN, "GPT ATTRIBUTES", SETID, ATTRIBUTES are 4 good ones to know even if you are not going to use Diskpart for partitioning.

While in the Diskpart sub-shell, the inbuilt Help docs are accessed their own way, type "help assign" for instance to get Assign syntax examples.

OTOH with the Attributes command, "Help Attributes" only tells you that you need to use "Help Attributes Volume" or "Help Attributes Disk" instead to get the examples you have in mind.

A lot of this stuff I know already but I still use the help docs a lot to copy & paste the syntax examples from the CMD window into Notepad for editing before copying back to execute.


I type `bcdedit /set "{bootmgr}" path \EFI\refind\refind_x64.efi` so many times a year that it's probably getting close to time to buy a macro keyboard so I can set it up on a macro.


I have rEFInd on a USB stick because I need to recover bootloaders on machines often enough. I commented on Lobsters recently the errors I've seen over the years.[0]

systemd-boot installs itself as bootx64.efi (or platform equivalent) if it doesn't already exist, and most motherboards will scan for it, which has reduced how often I need the USB stick.

[0]: https://lobste.rs/s/c6rk0l/14_years_systemd#c_e3dvnm




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: