Bugs item #3442669, was opened at 2011-11-26 03:47
Message generated for change (Tracker Item Submitted) made by
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3442669&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: com
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: https://www.google.com/accounts ()
Assigned to: Nobody/Anonymous (nobody)
Summary: Calling Win32_NetworkAdapterConfiguration routines fails
Initial Comment:
I am trying to set the ip address of a network interface using win32com module and unable to do so. I have tried searching a lot but wasn't able to get a answer for the issue. Here is the code I am running : import win32com.client
obj = win32com.client.Dispatch("WbemScripting.SWbemLocator")
wmobj = obj.ConnectServer("localhost","root\cimv2")
nobj = wmobj.ExecQuery("Select * from Win32_NetworkAdapterConfiguration")
for n in nobj:
print n.Caption
n.SetMTU('9000')
When I run this code it errors out with following error :
Traceback (most recent call last): File "", line 3, in n.SetMTU('9000') File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 505, in getattr ret = self.oleobj.Invoke(retEntry.dispid,0,invoke_type,1) com_error: (-2147352567, 'Exception occurred.', (0, u'SWbemObjectEx', u'Invalid method ', None, 0, -2147217362), None)
I did some more debugging and found that I can access any variables of Win32Networking class but whenever I try to call any routine of the class it returns me this same error.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3442669&group_id=78018
|