Static Ip Changer Program

Active1 year ago

How do I change the IP settings of a Windows CE 6 box Programatically via C++? Functions for Windows might also work.

Simple Static IP is a free program by PcWinTech.com to help users set their IP address to static with just a few clicks. At times there may be a reason you need to have your IP address set to static. A static IP is an IP address that never changes.

I found that I can change the hostname via sethostname but couldn't find how to change IP address settings such as:

  • IP Address
  • DHCP
  • Subnet
  • Gateway
  • DNS1 / DNS2
  • WINS1 / WINS2

Any advice / pointers would be great.Thanks.

P.s. How would you get the box to update to those settings - is a refresh or the programming equivalent of ipconfig /renew required?

Chris
ChrisChris
15.2k39 gold badges157 silver badges294 bronze badges

3 Answers

Have you checked out the IP Helper Routines on MSDN? I think these provide some, if not all, of what you need.

**EDIT: ** Updated link. Thanks ctacke

NG.NG.

Online Ip Changer

19.8k4 gold badges46 silver badges59 bronze badges

Ip Changer Tool

Most of these fall under the IpHlp API.

You don't really change an IP address -- you use DeleteIpAddress delete the old one, then AddIpAddress to add the new one. You specify the subnet mask when you add an address.

It's not clearly what you want to know about DHCP. You can use DHCP via IpReleaseAddress and IpRenewAddress. You can get the address of the current DHCP server with GetAdaptersInfo (among others). At least if memory serves, getting its address is mostly for information though -- since the basic idea of DHCP is to avoid manual configuration, you normally find/use it via a broadcast message.

You can set the DNS and WINS servers via the the WMI Win32_NetworkAdapterConfiguration class (SetDNSServerSearchOrder and SetWinsServer)

You can adjust quite a few (most?) of the other parameters via WMI as well.

Jerry Coffin

Static Ip Changer Programs

Ip address changerJerry Coffin
398k58 gold badges496 silver badges940 bronze badges

Caveat: using IpHelper, AddIpAddress, does NOT change the ip address persistently.After a reboot, the original NIC settings are back.

K.IsbruchK.Isbruch

Free Static Ip Changer

Not the answer you're looking for? Browse other questions tagged c++network-programmingwindows-ceip-address or ask your own question.