Dell 7.6 Computer Accessories User Manual


 
62 Sample Scripts and BIOS Settings
(Wscript.Arguments.Count < 1) Then
Call Usage()
WScript.Quit
End If
'*** Initialize variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_Configuration"
strKeyValue = "Configuration"
strPropName = "ForcePXEOnNextBoot"
'*** Retrieve the instance of Dell_Configuration class
(there should
'*** only be 1 instance).
Set objInstance =
GetObject("WinMgmts:{impersonationLevel=
impersonate}//" &_
strComputerName & "/" & strNameSpace & ":" &
strClassName & "=" & _
Chr(34) & strKeyValue & Chr(34))
strPropValue =
objInstance.Properties_.Item(strPropName).Value
'*** Set the new value for the property and save the
instance, but only
'*** if the current value is not already 3 ('Enabled')
If strPropValue <> 3 Then
objInstance.Properties_.Item(strPropName).Val
ue = 3
objInstance.Put_
'*** If any errors occurred, let the user know
If Err.Number <> 0 Then
WScript.Echo "Setting PXE on next
reboot failed."
End If
End If