Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Winpe2.0 network/ip setup issue

Featured Replies

Hi,

We are moving from WinPe1.6 to WinPe2.0. The problem comes when setting up networking. The network setup is now done using "wpeutil.exe InitializeNetwork" as against "factory.exe -winpe" for Winpe1.6. This brings up the network and assigns a dhcp ip to the card.

Now I require to reset this n/w interface and set static IPs onto it. This was achieved by setting the static IP into the (temporary winpe) registry and then calling dhcpNotifyConfigChange() (an undocumented win API) - This updates the in-memory IP table with the IP in the registry without requiring a reboot. This API, however, doesnt work for Winpe2.0 anymore. Does anybody know of any alternative windows API which can serve the purpose? I know netsh command is an alternative but I want some other means to achieve the goal.

Following are the challenges:

1. initial DHCP ip which is set when running wpeutil.exe; how do I change that to a static IP?

2. once its ready to take up static IPs how do I set the desired IP?

3. what if I need another set of IPs to be set for the same NIC - This I think can be achieved by calling AddIpAddress() win API

4. If I have added a static IP to the NIC how do I remove that (note that this is the IP *NOT* set using AddIpAddress())

Please note that what I am concerned about is setting the IPs temporarily and it doesnt matter if these are lost after reboot.

Thanks in advance!

~gk


Look at NetSH command. You will be able to get everything you need through that command

  • Author

Thanks for the pormpt response. As I said in my original post I want to use some pure win API for this and not use netsh.

I use WMI to modify the network settings. I wrote an HTA to provide a graphical interface that the user could use to enter the data and use the methods available to set the configuration.

Use the Win32_NetworkAdapterConfiguration WMI provider, it has all the methods needed to change the adapter configuration. Methods we use are EnableStatic, SetGateways, SetDNSDomain, SetDNSServerSearchOrder, SetWinsServer.

  • Author

as I understand WMI again is scripting .. My requirement is to avoid that as well .. thanks anyways!

any other suggestions?

~gk

I use WMI to modify the network settings. I wrote an HTA to provide a graphical interface that the user could use to enter the data and use the methods available to set the configuration.

Use the Win32_NetworkAdapterConfiguration WMI provider, it has all the methods needed to change the adapter configuration. Methods we use are EnableStatic, SetGateways, SetDNSDomain, SetDNSServerSearchOrder, SetWinsServer.

WMI isnt scripting. WMI = Windows Management Instrumentation. And I bet there is an API to access it.

  • 2 weeks later...
  • Author

Hi all,

Thanks for the suggestions.

I implemented this using WMI APIs. However, I am facing issues in the following scenario:

1. I set a static IP using enableStatic()

2. I run enableStatic() for another IP and the new IP gets added to the old one.

3. I run enableDHCP() and it enables DHCP (though the static IPs are still seen if I do ipconfig)

4. I tried ReleaseDHCPLease() and RenewDHCPLease() attempting to release the static IPs and get a DHCP ip. Though this doesnt happen.

My Doubts:

- In step (2) above, is there a way to replace the already set IP with the new one? Using EnableStatic() it adds to the existing static IP.

- In step (3), DHCP is enabled but the IPs shown with ipconfig are still the static IPs. Is there a way to get a DHCP ip and get rid of all the static ones? - not using netsh but using WMIs or other windows APIs.

- What effect does step (4) have? It didnt do anything! I expected it to release all the IPs and get a new DHCP one.

Kindly comment!

Thanks,

Gaurav

  • Author

Any suggestions on this?

Hi all,

Thanks for the suggestions.

I implemented this using WMI APIs. However, I am facing issues in the following scenario:

1. I set a static IP using enableStatic()

2. I run enableStatic() for another IP and the new IP gets added to the old one.

3. I run enableDHCP() and it enables DHCP (though the static IPs are still seen if I do ipconfig)

4. I tried ReleaseDHCPLease() and RenewDHCPLease() attempting to release the static IPs and get a DHCP ip. Though this doesnt happen.

My Doubts:

- In step (2) above, is there a way to replace the already set IP with the new one? Using EnableStatic() it adds to the existing static IP.

- In step (3), DHCP is enabled but the IPs shown with ipconfig are still the static IPs. Is there a way to get a DHCP ip and get rid of all the static ones? - not using netsh but using WMIs or other windows APIs.

- What effect does step (4) have? It didnt do anything! I expected it to release all the IPs and get a new DHCP one.

Kindly comment!

Thanks,

Gaurav

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.