Q
Quentin Liedtke
For those of you out there that are using custom shells and user editable
network settings, how are you doing it? My situation is that our users
should be able to adjust their network settings (DHCP on/off, set static IP
and set subnet mask) and I have yet to find a solution that is always
reliable.
Here's the possible solutions that I have researched:
1. IP Helper API using AddIPAddress and DeleteIPAddress: Only adds an IP
address to the adapter, will not change the current one.
2. WMI using Win32_NetworkAdapterConfiguration: Haven't tried this yet, but
it seems that I will have to add a lot of code to get it working, not to
mention having to include many more components to add support for WMI.
3. netsh: I have had some success with using WinExec and manufacturing the
command line based on the information I get from the user. The problem is
that it's not a synchronous call so I have no idea when the command has
completed.
4. DhcpNotifyConfigChange: haven't tried this yet, but it looks like it will
do what I want it to do. The problem with DhcpNotifyConfigChange is that
it's an undocumented API.
5. Editing the registry: apparently this works, but you have to reboot the
computer for the change to take affect. I would prefer to not have to go
back to the days of rebooting to see if my network settings worked.
Anyone out there solve this issue?
Quentin.
network settings, how are you doing it? My situation is that our users
should be able to adjust their network settings (DHCP on/off, set static IP
and set subnet mask) and I have yet to find a solution that is always
reliable.
Here's the possible solutions that I have researched:
1. IP Helper API using AddIPAddress and DeleteIPAddress: Only adds an IP
address to the adapter, will not change the current one.
2. WMI using Win32_NetworkAdapterConfiguration: Haven't tried this yet, but
it seems that I will have to add a lot of code to get it working, not to
mention having to include many more components to add support for WMI.
3. netsh: I have had some success with using WinExec and manufacturing the
command line based on the information I get from the user. The problem is
that it's not a synchronous call so I have no idea when the command has
completed.
4. DhcpNotifyConfigChange: haven't tried this yet, but it looks like it will
do what I want it to do. The problem with DhcpNotifyConfigChange is that
it's an undocumented API.
5. Editing the registry: apparently this works, but you have to reboot the
computer for the change to take affect. I would prefer to not have to go
back to the days of rebooting to see if my network settings worked.
Anyone out there solve this issue?
Quentin.