change ip adderss in win2k

I would like to know if there is an api function in win2k
to change NIC's ip address without rebooting the computer.
Also to change from static ip to DHCP settings, again without rebooting.

Thanks.
dudilAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
CetusMODConnect With a Mentor Commented:
PAQed - no points refunded (of 100)

CetusMOD
Community Support Moderator
0
 
jhanceCommented:
See:

http://jwhance.elosoft.com/alcoholic_texts.htm

It's a copy of a now missing web page that describes a useful technique for this.  While it's targeted at NT4, this works on Windows 2000 (and so far on Windows XP) also.

There is an API in the IPHLPAPI.DLL starting in Win2000 called AddIpAddress() but you'll find that it is practically useless.  Further, an investigation of what Microsoft does in the Network Control Panel reveals that they use the DhcpNotifyConfigChange() call as described in the article.
0
All Courses

From novice to tech pro — start learning today.