Vbscript / Operating System / Dell Bios View Device Boot Order
This script enumerates the BIOS boot devices on a Dell machine with Open Manager Client Instrumentation (OMCI) installed and displays the boot order and status.
strComputerName = "." strNameSpace = "root/Dellomci" strClassName = "Dell_BootDeviceSequence"
intKey = 0
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) & intKey & Chr(34))
strDeviceName = objInstance.Properties_.Item("BootDeviceName").Value strDeviceOrder = objInstance.Properties_.Item("BootOrder").Value strDeviceStatus = objInstance.Properties_.Item("Status").Value intKey = intKey + 1
strDeviceStatus = objInstance.Properties_.Item("Status").Value strDeviceOrder = objInstance.Properties_.Item("BootOrder").Value
strMsg = strDeviceName strMsg = strMsg & vbCRLF & "Boot Position: " & strDeviceOrder strMsg = strMsg & vbCRLF & "Boot Status: " If strDeviceStatus = "1" Then strMsg = strMsg & "On" Else strMsg = strMsg & "Off" End If
If strDeviceName = "Internal HDD" Then
strDeviceOrder = objInstance.Properties_.Item("BootOrder").Value strDeviceStatus = objInstance.Properties_.Item("Status").Value
strMsg = strDeviceName strMsg = strMsg & vbCRLF & "Boot Position: " & strDeviceOrder strMsg = strMsg & vbCRLF & "Boot Status: " If strDeviceStatus = "1" Then strMsg = strMsg & "On" Else strMsg = strMsg & "Off" End If
End If
If strDeviceName = "Hard-Disk Drive C:" Then
strDeviceOrder = objInstance.Properties_.Item("BootOrder").Value strDeviceStatus = objInstance.Properties_.Item("Status").Value
strMsg = strDeviceName strMsg = strMsg & vbCRLF & "Boot Position: " & strDeviceOrder strMsg = strMsg & vbCRLF & "Boot Status: " If strDeviceStatus = "1" Then strMsg = strMsg & "On" Else strMsg = strMsg & "Off" End If
End If
If strDeviceName = "Onboard SATA Hard Drive" Then
strDeviceOrder = objInstance.Properties_.Item("BootOrder").Value strDeviceStatus = objInstance.Properties_.Item("Status").Value strMsg = strDeviceName strMsg = strMsg & vbCRLF & "Boot Position: " & strDeviceOrder strMsg = strMsg & vbCRLF & "Boot Status: " If strDeviceStatus = "1" Then strMsg = strMsg & "On" Else strMsg = strMsg & "Off" End If End If
WScript.Echo strMsg
Next
Please note that a disclaimer applies to any code on this page.
|