This script sets the Dell BIOS boot device order such that the onboard hard drive boots first and disables all other boot devices. Requires that Dell Open Manage Client Instrumentation (OMCI) is installed.
strComputerName = "."
strNameSpace = "root/Dellomci"
strClassName = "Dell_BootDeviceSequence"
intKeyVal = 0
intBootOrder = 2
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,AuthenticationLevel=pktprivacy}\" & strComputerName & "\root\dellomci")
Set ColSystem=objWMIService.execquery ("Select * from Dell_BootDeviceSequence")
For Each objSystem in ColSystem
Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate,AuthenticationLevel=pktprivacy}\" & _
strComputerName & "/" & strNameSpace & ":" & strClassName & "=" & _
Chr(34) & intKeyVal & Chr(34))
intKeyVal = intKeyVal + 1
strDeviceName = objInstance.Properties_.Item("BootDeviceName").Value
strDeviceOrder = objInstance.Properties_.Item("BootOrder").Value
strDeviceStatus = objInstance.Properties_.Item("Status").Value
objInstance.Properties_.Item("Status").Value = 0
objInstance.Put_
strDeviceStatus = objInstance.Properties_.Item("Status").Value
strDeviceOrder = objInstance.Properties_.Item("BootOrder").Value
strMsg = "Disabled " & strDeviceName
strMsg = strMsg & ". Position: " & strDeviceOrder
strMsg = strMsg & ". Status: " & strDeviceStatus
If strDeviceOrder = 1 Then
objInstance.Properties_.Item("BootOrder").Value = intBootOrder
objInstance.Put_
intBootOrder = intBootOrder + 1
End If
If strDeviceName = "Onboard SATA Hard Drive" OR strDeviceName = "Internal HDD" OR strDeviceName = "Hard-Disk Drive C:" Then
objInstance.Properties_.Item("BootOrder").Value = 1
objInstance.Properties_.Item("Status").Value = 1
objInstance.Put_
strDeviceOrder = objInstance.Properties_.Item("BootOrder").Value
strDeviceStatus = objInstance.Properties_.Item("Status").Value
strMsg = "Enabled " & strDeviceName
strMsg = strMsg & ". Position: " & strDeviceOrder
strMsg = strMsg & ". Status: " & strDeviceStatus
End If
WScript.Echo strMsg
Next