Hi,

> c = wmi.WMI()
> for service in c.Win32_Service ('State == 'Stopped')

I would think that using c.Win32_Service() and iterating would get you anything 
you want. 
In ur case of using ('State == 'Stopped') ... (if this ever works)

c.Caption would have given you the caption....

Marcus. 


  ----- Original Message ----- 
  From: mark.a.brand 
  To: Python-Win32 List 
  Sent: Monday, March 24, 2008 10:06 AM
  Subject: [python-win32] wmi query.


  hi:

  how do you incorporate a where clause and selected field clause in a wmi 
query ? 

  this gets me caption and state fields for all services
    c = wmi.WMI()
    for service in c.Win32_Service (['Caption', 'State'])
       ...

  this gets me all fields for stopped services 
  c = wmi.WMI()
  for service in c.Win32_Service ('State == 'Stopped')
     ....

  is the way to incorporate both queries into one something like this
  c = wmi.WMI()
  for service in c.Win32_Service (['Caption', 'State'])  WHERE ('State == 
'Stopped')

  cheers
  mark




------------------------------------------------------------------------------


  _______________________________________________
  python-win32 mailing list
  python-win32@python.org
  http://mail.python.org/mailman/listinfo/python-win32
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to