<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.6000.16609" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>&gt; c = wmi.WMI()<BR>&gt; for service in c.Win32_Service ('State == 
'Stopped')<BR></DIV>
<DIV><FONT face=Arial size=2>I would think that using <FONT 
face="Times New Roman" size=3>c.Win32_Service() and iterating would get you 
anything you want. </FONT></FONT></DIV>
<DIV>In ur case of using ('State == 'Stopped') ... (if this ever 
works)<BR></DIV>
<DIV><FONT face=Arial size=2>c.Caption would have given you the 
caption....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Marcus. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=mark.a.brand@gmail.com 
  href="mailto:mark.a.brand@gmail.com">mark.a.brand</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=python-win32@python.org 
  href="mailto:python-win32@python.org">Python-Win32 List</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, March 24, 2008 10:06 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [python-win32] wmi query.</DIV>
  <DIV><BR></DIV>hi:<BR><BR>how do you incorporate a where clause and selected 
  field clause in a wmi query ? <BR><BR>this gets me caption and state fields 
  for all services<BR>&nbsp; c = wmi.WMI()<BR>&nbsp; for service in 
  c.Win32_Service (['Caption', 'State'])<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
  ...<BR><BR>this gets me all fields for stopped services <BR>c = 
  wmi.WMI()<BR>for service in c.Win32_Service ('State == 
  'Stopped')<BR>&nbsp;&nbsp; ....<BR><BR>is the way to incorporate both queries 
  into one something like this<BR>c = wmi.WMI()<BR>for service in 
  c.Win32_Service (['Caption', 'State'])&nbsp; WHERE ('State == 
  'Stopped')<BR><BR>cheers<BR>mark<BR><BR>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>python-win32 mailing 
  list<BR>python-win32@python.org<BR>http://mail.python.org/mailman/listinfo/python-win32<BR></BLOCKQUOTE></BODY></HTML>