2

I am trying to enable/disable network binding interfaces in Windows using Python. See the picture below:

Netwok binding interfaces dialog box

I've understand that I have to utilize INetCfg COM interfaces for this. And I believe comtypes is the proper way to do this in Python. But still, I am pretty much new to comtypes.

The following page is how to disable/enable IPv6 in C. Does that C version can be easily converted to python using Comtypes?

1 Answer 1

1

Quick update : I have solved this. You will have to:

  1. Generate TLB for INetCfg interface
  2. Import it into Python using Comtypes
  3. Create a COM object of INetCg instance
  4. Acquire write lock
  5. FindComponent for a given NIC
  6. Enumarate protocol for that given NIC
  7. Bind/Unbind protocol from given NIC
  8. Apply changes
  9. ReleaseLock

I will elaborate it as soon as I have time for this You will have to get acquainted of comtypes to easily implement this.

Sign up to request clarification or add additional context in comments.

1 Comment

Did you have this time ever since? ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.