A. A. There are only a few basic registry entries that define a client as a DHCP client so an easy way to migrate clients to DHCP is to create a registry script that sets the required values via logon script. You should obviously be careful that there is no overlap between the addresses in the DHCP address pool and those statically assigned.

The DHCP service needs to be configured to start at system startup.Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCP\ and change the value entry Start from 1 to 2.

TCPIP parameters are defined to each NIC (Network Interface Card).

The following is an example registry script you may consider using. If you are unsure of the card service goto HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\1 and write down the data for the value entry ServiceName

REGEDIT4

\[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\\Parameters\Tcpip\]
"EnableDHCP"=dword:00000001
"IPInterfaceContext"=dword:00000001
"IPInterfaceContextMax"=dword:00000001

You should then add something into the logon script to detect the NIC installed into the computer, run the reg script and request an IP address, e.g.

if reg=elpc575 (for the 3com575tx) goto dhcp
..
..
..
:dhcp
regedit /s NIC_dhcp.reg
ipconfig /renew
net send %computername% Congrats Your computer has been configured for DHCP!
endif

A quick way to find out which network card you are using is on you LAN you will have various types of NIC.

For instance you may have the 3c89d, netflx3,3c575tx for instance for the Neflx3 driver, when the install takes place on the NT 4.0 it adds a registry key in the HKEY_LOCAL_MACHINE\systems\Current control set\system\services\cpqNF31 with the parameters:

\[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CpqNF31\Parameters\Tcpip\]
"EnableDHCP"=dword:00000000.

You have to find out what the key name is because it is different for each NIC then you can run kix32.exe and use the arguement:

EXISTKEY (
"Key"
)

Checks for the existence of a registry key.

Parameters
Key - Identifies the key you want to check the existence of.

Returns
0 the key specified exists (Note : this is different from the way the EXIST function works...)
>0 the key does not exist, returncode represents an errorcode

$ReturnCode=ExistKey(
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CpqNF31" )

If $ReturnCode=0
? "Key exists...."
Endif

...to detemine if the key exist and then execute accordingly for that specific card.

You may also set the value IPAddress=0.0.0.0 and value SubnetMask=0.0.0.0 for the card service however they will be ignored anyway. Fill in the IPAddress and SubnetMask with 0.0.0.0. Blanking out or deleting the values won't work. Restart the workstation to complete the change.

This can also be done using Windows Scripting Host

From MS SupportOnline Article ID: Q197424

'-----------------------------------------------------------------------
   ' The following script reads the registry value name IPAddress to
   ' determine which registry entries need to be changed to enable DHCP.
   ' This sample checks the first 11 network bindings for TCP/IP, which is
   ' typically sufficient in most environments.
   ' ----------------------------------------------------------------------
   Dim WSHShell, NList, N, IPAddress, IPMask, IPValue, RegLoc
   Set WSHShell = WScript.CreateObject("WScript.Shell")

   NList = array("0000","0001","0002","0003","0004","0005","0006", _
                 "0007","0008","0009","0010")

   On Error Resume Next
   RegLoc = "HKLM\System\CurrentControlSet\Services\Class\NetTrans\"

   For Each N In NList
     IPValue = ""      'Resets variable
     IPAddress = RegLoc & N & "\IPAddress"
     IPMask = RegLoc & N & "\IPMask"
     IPValue = WSHShell.RegRead(IPAddress)
     If (IPValue <> "") and (IPValue <> "0.0.0.0") then
       WSHShell.RegWrite IPAddress,"0.0.0.0"
       WSHShell.RegWrite IPMASK,"0.0.0.0"
     end If
   Next

   WScript.Quit        ' Tells the script to stop and exit.