Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I assign a static ip address to my windows ce 6.0 device.

4,835 views
Skip to first unread message

Don

unread,
Jul 2, 2009, 9:57:02 AM7/2/09
to

HI

I have a 7F2WE 1G5D-OC-LF mother board from Jetway running Windows CE 6.0.
I would like set a static ip address so the device always comes up with the
same ip address. Can you please supply some instructions?

--
Don

Erwin Zwart

unread,
Jul 2, 2009, 10:16:01 AM7/2/09
to

You can do that via the registry:

HKEY_LOCAL_MACHINE\Comm\<YourAdapter>\Parms\TcpIp]
"EnableDHCP"=dword:0
"DefaultGateway"="192.168.1.1"
"UseZeroBroadcast"=dword:0
"IpAddress"="192.168.1.100"
"Subnetmask"="255.255.255.0"

for the reference in MSDN:
http://msdn.microsoft.com/en-us/library/aa930280.aspx

Good luck,

Erwin Zwart,
Check out my blog: http://GuruCE.com/blog

GuruCE
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

Don schreef:

Don

unread,
Jul 2, 2009, 10:29:02 AM7/2/09
to

Is there a way to do it remotely? By use remoteadmin?
--
Don

Paul G. Tobey [eMVP]

unread,
Jul 2, 2009, 11:10:26 AM7/2/09
to

It wouldn't be a static address that the device always comes up with if you
have to wait until after it boots to set it and, until you've set it, how
would you contact it remotely? It doesn't have an IP address (or it doesn't
have one that you know the value of)! You can set the IP address through
the user interface, of course.

Maybe you should give us the full story and let us suggest how to do it.

Paul T.

"Don" <D...@discussions.microsoft.com> wrote in message
news:C4FBE4D3-D8B8-4C80...@microsoft.com...

Don

unread,
Jul 2, 2009, 11:34:01 AM7/2/09
to

Hi Paul,

Thanks for your reply. Sorry here is the whole the story. Write now I have
built Windows CE 6.0 image that has the DHCP turned on and ip addresses are
generated dynamically. I have a customer who would like to be able to set an
ip address of their choice. I would prefer not to have to rebuild my nk.bin
to accomadate them. If I have to then I will have a special nk.bin
specifically for that customer. I would prefer if I could write some code to
do it on the fly after the machine boots. Is that possible? I have already
done something by importing the winsock.dll to set the hostname like this

[DllImport("winsock.dll", SetLastError = true)]
public static extern int sethostname(Byte[] name, int cbName);

and then calling sethostname where I choose from a C# program.
I am interested in a coding solution that would turn off the DHCP and set an
ip address on the fly after the machine boots up so that it is always the
same. Your statement

"You can set the IP address through
> the user interface, of course"

Can you expand on this for me please?

--
Don

Chris Tacke, eMVP

unread,
Jul 2, 2009, 11:46:37 AM7/2/09
to

Go into the network settings UI on the device (in the COntrol Panel) and set
the IP to static and enter the IP. I don't understand the difficulty. You
obvioulsy can't set it in the image, unless they are shipping one and only
one device, otherwise every device would have the same IP.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Don" <D...@discussions.microsoft.com> wrote in message

news:5C087142-1C29-4DDD...@microsoft.com...

Don

unread,
Jul 2, 2009, 1:28:01 PM7/2/09
to

Hi Chris,

Thanks for the reply. I realize you can set it in the manner you have
described. It does go back to its original state after a reboot and the
static ip is not retained. The customer would like to have the setting
retained so they don't have to do this every time the device is rebooted.
The fact that it can be change on the fly tells me I could have them put the
ip in a text file and I could write program that reads the text file and set
it using a program. Can you point me in the right direction where I can find
some documentation to inport a dll or something and set it using function
calls?
--
Don

Paul G. Tobey [eMVP]

unread,
Jul 2, 2009, 1:35:46 PM7/2/09
to

If it goes back, then you have not saved the registry. It should be clear
that, if you have no persistent data, nothing will be 'stored' for later.
If the registry is never persistent on the device, then you have to fix
that. The *right* way to set it is by having the registry persist. Yes,
you can change it from code, BY CHANGING THE REGISTRY, and telling the
adapter to rebind with the new registry settings, but that's silly. I've
previously posted exactly what you need to do to change it via code. You
should be able to search microsoft.public.windowsce.* in GoogleGroups
advanced groups search and find that/those posts...

Paul T.

"Don" <D...@discussions.microsoft.com> wrote in message

news:4604670A-CF1A-4BC4...@microsoft.com...

Bradley Remedios

unread,
Jul 2, 2009, 2:09:48 PM7/2/09
to
On Jul 2, 10:35 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT

no instrument no spam DOT com> wrote:
> If it goes back, then you have not saved the registry.  It should be clear
> that, if you have no persistent data, nothing will be 'stored' for later.
> If the registry is never persistent on the device, then you have to fix
> that.  The *right* way to set it is by having the registry persist.  Yes,
> you can change it from code, BY CHANGING THE REGISTRY, and telling the
> adapter to rebind with the new registry settings, but that's silly.  I've
> previously posted exactly what you need to do to change it via code.  You
> should be able to search microsoft.public.windowsce.* in GoogleGroups
> advanced groups search and find that/those posts...

I agree with Paul that your problem is most likely due to your
settings not persisting properly in the registry.

You need to have a persistent registry in your device (lookup up hive-
based registry) for it to keep the settings.

If you already have a hive-based registry make sure that you don't
reboot it before the new settings are written to your flash device.
You either need to manually flush the registry to disk or ensure that
your configuration is such that CE will automatically flush the
registry to disk for you.

Regards,
Brad.

> "Don" <D...@discussions.microsoft.com> wrote in message

Bruce Eitman [eMVP]

unread,
Jul 2, 2009, 3:51:30 PM7/2/09
to

If you are using hive registry, you could also suspend/resume which would
flush the registry.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"Bradley Remedios" <brem...@gmail.com> wrote in message
news:2b0f81f5-8691-428c...@37g2000yqp.googlegroups.com...

Roger Smith

unread,
Sep 8, 2023, 12:30:11 AM9/8/23
to
Hi everyone!
There was a problem with setting up a permanent static IP address on a sheet bending machine running Windows CE.
The solution was simple.
Make changes to the network card settings through the control panel, and then enter “saveregistry” in the command prompt.
then confirm making changes to the registry and that’s it, now it will always boot with these settings.




0 new messages