Hiya,
This is the code I have used in the past,
unfortunately I cannot claim the credit for writing it , but like everything else..... share and share alike


best of luck

steve

;-----------------------------------------------------
; File - DHCP95.Kix
; Logic - Change Workstation to DHCP
; Changes - 6/8/99 (hef) Created
; 6/9/99 (jmb) Added multiple NIC Support

$ComputerName=ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName")
$HKLM = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services"
$Index = 0
$Reboot = "NO"
:Loop1
$KeyName = ENUMKEY( "$HKLM\Class\NetTrans\" , $Index )
$RC = @ERROR
$DHCPEnabled=ReadValue("$HKLM\Class\NetTrans\$KeyName","IPAddress")
$Index = $Index + 1
If $RC = 0
If $DHCPEnabled <> "0.0.0.0"
$Reboot = "YES"
;---------------------------------------------------
;Updating to DHCP...
;---------------------------------------------------
; Set DHCP Settings
$ReturnCode = WRITEVALUE( "$HKLM\Class\NetTrans\$KeyName" , "IPAddress" , "0.0.0.0" , "REG_SZ")
$ReturnCode = WRITEVALUE( "$HKLM\Class\NetTrans\$KeyName" , "IPMask" , "0.0.0.0" , "REG_SZ")
$ReturnCode = DELVALUE( "$HKLM\Class\NetTrans\$KeyName" , "DefaultGateway")
;---------------------------------------------------
; Clear WINS, DNS, and check Enable DNS Windows Resolution in WINS
;---------------------------------------------------
$ReturnCode = WRITEVALUE( "$HKLM\VxD\MSTCP" , "EnableDNS" , "0" , "REG_SZ")
$ReturnCode = DELVALUE( "$HKLM\VxD\MSTCP" , "NameServer")
$ReturnCode = DELVALUE( "$HKLM\VxD\MSTCP" , "NameServer1")
$ReturnCode = DELVALUE( "$HKLM\VxD\MSTCP" , "NameServer2")
$ReturnCode = DELVALUE( "$HKLM\VxD\MSTCP" , "SearchList")
$ReturnCode = DELVALUE( "$HKLM\VxD\MSTCP" , "Domain")
$ReturnCode = DELVALUE( "$HKLM\VxD\MSTCP" , "NodeType")
$ReturnCode = DELVALUE( "$HKLM\VxD\MSTCP" , "ScopeID")
Endif
goto Loop1
Endif