Change IP address and HostName of NT machine

Environment: NT4 SP5

How to set local machine IP addresses from your program ?

Follow this steps

1. Open registry on the HKEY_LOCAL_MACHINE

2. Find the subKey = SOFTWAREMicrosoftWindows NTCurrentVersionNetworkCardsnetcard#
netcard# usually is “1” but you can control any subkey and find specific netwrok Adapters Refer to “MSDN Registry Entries for Network Adapter Cards”

3. Get data for the value “ServiceName”

4. Find the subKey = SYSTEMCurrentControlSetServices”ServiceName”ParametersTcpIp”

5. Set data for the value “IpAddress” to change IP address

6. Set data for the value “SubnetMask” to change subnet mask

7. Set data for the value “DefaultGateway” to change default gateway

8. Reboot your PC.

How to set local machine HostName from your program ?

Follow this steps:

1. Open registry on the HKEY_LOCAL_MACHINE

2. Find the subKey = SYSTEMCurrentControlSetServicesTcpIpParameters

3. Set data for the value “HostName”

4. Find the subKey = SYSTEMCurrentControlSetControlComputerNameComputerName

5. Set data for the value “ComputerName”

6. Reboot your PC and HostName will be set.


WARNING: Modify registry incorrect can cause serious, system-wide problems . Use this at your own risk

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read