|
|
||||||
|
#1
|
|
|
|
|
I'm trying to find a way to enable a network interface with C++.
After trying various methods, I ended up looking at WMI. I found a Win32_NetworkAdapter class that had an Enable/Disable function, which looked perfect for what I needed. Unfortunately, the Enable function was only supported in Vista. Is there another class in XP that I can use to Enable an interface. thanx, mark |
|
|
|
#2
|
|
|
|
|
Did you try SetIfEntry() before you turn to WMI ? Just a hint
Arkady "Mark Kyprianou" <MarkKyprianou> wrote in message news:c14a [..] |
|
#3
|
|
|
|
|
The IP Helper functions typically use an interface index. Depending on what
I’m doing, I use various methods to get this interface index. Typically I use GetAdaptersInfo or GetAdaptersAddresses. Interfaces that are disabled are not returned via these calls. So I was unable to try to enable a disabled interface. However, to see if the call worked, I tried to disable an enabled interface. By setting dwAdminStatus field via the SetIfEntry. I was expecting to see the “status” in the RMB on My Network Places->Properties show disabled. This did not happen, but the interface was “down” or not usable… ( I could not ping or access anything on the network) So the call did something, but I’m not sure exactly what. Just what is the dwAdminStatus field? Is there a different field that I should have set? thanx for your response, mark "Arkady Frenkel" wrote: [..] |
|
#4
|
|
|
|
|
No, look at the description in MSDN or set to MIB_IF_ADMIN_STATUS_DOWN or
MIB_IF_ADMIN_STATUS_UP and check return code. You need to check index when NIC enabled because system return the same index for adapter when it's on Arkady "Mark Kyprianou" <MarkKyprianou> wrote in message news:3f10 [..] |
|
#5
|
|
|
|
|
Additionally look at http://www.gershnik.com/faq/manage.asp#enable
Arkady "Arkady Frenkel" <arkadyf> wrote in message news:a388 [..] |
|
|
| Similar Threads | |
| How do I enable DHCP on my network adapter? When I check the status of my network adapter, it says that DHCP is not enabled. How do I enable it in Windows Vista Ultimate? I'm trying to enable it for ICS to/with a... |
|
| How enable network adapter in script? On Windows XP Pro SP2 I need to enable or disable a network adapter using netsh.exe but the command: netsh interface set interface name="Wired LAN" admin=ENABLED fails with... |
|
| How to Dis/Enable Network Adapter? Hi all, i would like now to disable and enable network adapter programmatically with c#. I have searched but found nothing useful. There's no topic about this problem. Has... |
|
| Enable Network Adapter in win98 / Me Hi, I am trying to enable network adapter through SetupAPIs. I am using SetupDiChangeState Method and have also tried SetupDiCallClassInstaller Method. The code is working... |
|
| enable/disable network adapter I am looking for a way to quickly disable and enable network adapters from the command line. I'm pretty sure Netsh can do it but I haven't been able to find exactly how. ... |
|
|
All times are GMT. The time now is 12:46 PM. | Privacy Policy
|