ZTINicUtility.vbstrue
OSDAdapterCount.value -1 then
' Disable and Hide
document.GetElementByID("OSDAdapter" & i & "DHCP").disabled = true
document.GetElementByID("OSDAdapter" & i & "Display").style.display = "none"
DisableMain = True
Else
document.GetElementByID("OSDAdapter" & i & "Display").style.display = "inline"
document.GetElementByID("OSDAdapter" & i & "DHCP").disabled = False
DisableMain = cbool(document.GetElementByID("OSDAdapter" & i & "DHCP").Checked)
End if
for each j in array("IPAddressList","SubnetMask","Gateways","DNSServerList","DNSSuffix","WINSServerList")
document.GetElementByID("OSDAdapter" & i & j ).Disabled = DisableMain
next
next
ParseAllWarningLabels
End function
Function ValidateNetworkDialog
Dim sErrorMsg
Dim oItem
Dim i,j
Dim bDirty
' Possible that the user didn't mean to select this dialog.
bDirty = false
for i = 0 to (OSDAdapterCount.value -1)
If not cbool(document.GetElementByID("OSDAdapter" & i & "DHCP").Checked) then
bDirty = true
exit for
End if
next
If not bDirty then
oLogging.CreateEntry "Welcome NIC Settings, Early Exit." , LogTypeInfo
window.close
End if
for i = 0 to (OSDAdapterCount.value -1)
If cbool(document.GetElementByID("OSDAdapter" & i & "DHCP").Checked) then
oLogging.CreateEntry "Clear out settings. OSDAdapter" & i & "MacAddress = " & document.GetElementByID("OSDAdapter" & i & "MacAddress" ).Value, LogTypeInfo
for each j in array("IPAddressList","SubnetMask","Gateways","DNSServerList","DNSSuffix","WINSServerList")
oEnvironment.Item("OSDAdapter" & i & j ) = ""
next
oEnvironment.Item("OSDAdapter" & i & "MacAddress" ) = ""
Else
for each j in array("MacAddress","IPAddressList","SubnetMask","Gateways","DNSServerList","DNSSuffix","WINSServerList")
oEnvironment.Item("OSDAdapter" & i & j ) = document.GetElementByID("OSDAdapter" & i & j ).Value
next
End if
next
oEnvironment.Item("OSDAdapterCount") = OSDAdapterCount.Value
' Load the settings into the device via WMI
i = 0
For each oItem in ObjNetworkAdapters
If cbool(document.GetElementByID("OSDAdapter" & i & "DHCP").Checked) = False then
sErrorMsg = LoadNetworkAdapterSettings ( oItem, i )
End if
i = i + 1
Next
if sErrorMsg <> "" then
Dim sNicMessage
sNicMessage = "Network settings have been applied except for the following:" & vbNewLine & vbNewLine
sNicMessage = sNicMessage & sErrorMsg & vbNewLine & vbNewLine & "OK to Continue?"
if MsgBox (sNicMessage, vbYesNo, "Networking Settings Error" ) <> vbYes then
ValidateNetworkDialog = FALSE
exit function
end if
end if
' Re-process Bootstrap.ini in case the network settings have changed something
oShell.run "WScript.exe " & oUtility.ScriptDir & "\ZTIGather.wsf /inifile:Bootstrap.ini",1, true
' We are done. Settings have been saved. Hard Exit!
window.close
end function
]]>
Specify the static IP network settings to be used.