views:

73

answers:

1

Does anyone know how to change the subnet mask and the DHCP enabled flag on Windows XP / Vista / 7 from a C++ program?

The Windows API has a GetAdaptersInfo() routine which will give you that information, but I need the counterpart SetAdaptersInfo() which doesn't seem to exist. I've looked all over MSDN and the web and don't see how to do it on newer-than-Windows-NT machines.

Any information is greatly appreciated.

+1  A: 

You can change this with the IPHelp API, but you need to use the functions AddIPAddress, DeleteIPAddress etc.

harper
Thank you! That is what I was looking for. :-)- Don
Don
@Don, would you mind accepting the answer?
harper