Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programatically define TCP/IP Properties

Status
Not open for further replies.

rcgold

Programmer
Mar 14, 2002
2
0
0
US
I would like to programatically modify a machines TCP/IP properties. More specifically, the static IP address, subnet mask, and default gateway.

Is there a API that supports this capability under Windows 2000 and/or Windows NT?

Also, is there an API that supports access to the adapter settings? That is, the speed (10 vs 100 mbs) and duplex mode (half vs full)?

If either of these APIs exist I would appreciate any information on how to use them including code fragments.

Thanks,

Rob


 
Rob,

What you want is called Windows Management Instrumentation (WMI) which is also known as Web Based Enterprise Management (WBEM). I have no practical experience with the technology but I thought I would give you a couple of pointers so that you can start.

In the case of the adapter settings, you will need to have an NDIS 5.0 specification driver for the adapter to do these operations. See here for some architectural information:


One thing to note, the TCP/IP configuration is in the registry at:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\<Adapter GUID goes here>\IP Address

You can, in theory, diddle the registry directly. However, I believe that there is a way of doing this using WMI, but I haven't had the time to follow this right through.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top