How to change BIOS boot order using cmd or powershell?

3.5k Views Asked by At

I'm trying to change the OS on a client machine from a server using Microsoft Deployment Toolkit. The deployment has to be fully automated (can't touch the client to even press any key). For a PXE boot, if I initially set the network card as first boot device on the client, it will then enter a boot loop since the client will always enter the network to boot. Either I need to force the client to somehow PXE boot only once or change the boot order programmatically during deployment. Really need some help with this.

2

There are 2 best solutions below

1
On

On HP machines, you can set the wake on lan boot source.
If you set this to PXE then you can keep your hard drive as the default boot device.
You would need to wake your PC's of course instead of manually pressing the power buttons.

0
On

For UEFI machines you could use bcdedit /default command to change the default boot entry.

Caveat: the IDs differ per machine, so you would have to enumerate them first.

Official documentation: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/bcdedit