Unsolved
1 Message
0
469
January 14th, 2021 12:00
Disable all boot devices with WMI
I'm creating a script to disable unwanted boot devices.
Following the docs, I am calling DCIM_BootConfigSetting.ChangeBootOrder() and passing in the Source parameter the array of devices without including those that I want to disable.
That works fine when I want to disable some devices, but not when I want to disable all the devices, for example:
These are the boot devices that are configured in my computer in format "Name-Enabled-Id":
Boot Order 1 (Legacy):
> Internal HDD (IRRT)-1-1
> USB Storage Device-2-2
> Diskette Drive-0-0
> CD/DVD/CD-0-3
> Onboard NIC-0-4
Boot Order 2 (UEFI):
> UEFI: INT13(,0x81)-1-5 // <- This is a booteable USB
I want to disable all devices except "Internal HDD (IRRT)" which is my Hard Drive.
For Boot Order 1 is easy, I pass in the Source parameter an array with just "Internal HDD (IRRT)" and It disables the other four devices.
But it does not work for Boot Order 2, if I try to pass in the Source parameter an empty array or a device that is not in the Boot Order 2 list it throws an "Invalid Parameter" error.
Do you know how to disable all the options in Boot Order 2?


