WMI - Restore Setting in Python

saw huan chng schng6 at yahoo.com
Mon Oct 10 19:34:35 EDT 2005


Hi,

I am beginner in Python. I have some questions on WMI Service in Python. I was able to use properties of Class Restore in WMI, but not able to use the method. Here is the sample code that I done, anyone can help me?

import win32com.client

strComputer = "."
objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator")
objSWbemServices = objWMIService.ConnectServer(strComputer,"root\DEFAULT")
testobj = objSWbemServices.Get("SystemRestore")

sequence_number = 11

result = testobj.Restore(sequence_number)

Traceback (most recent call last):
 File "C:\Documents and Settings\Fish\Desktop\RP_test.py", line 18, in ?
   result = testobj.Restore(sequence_number)
 File "c:\Python23\Lib\site-packages\win32com\client\dynamic.py", line 471, in
__getattr__
   raise pythoncom.com_error, details
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'SWbemObjectEx',
'Invalid parameter ', None, 0, -2147217400), None)

Thanks.

		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20051010/159e1b4e/attachment.html>


More information about the Python-list mailing list