To make talking about it easier, I've slightly reworked
your code to make it run completely (ie I've added imports and
the initialisation of the data structures) and
to take advantage of the wmi module's built-in features.
Hopefully it's perfectly clear what's going on; I've just avoided
some
Nick Moszer wrote:
Hello,
I'm occasionally receiving the following error when doing a set of queries:
Traceback (most recent call last):
File "psg5220_demo.py", line 236, in find_hdd_drives
partitions = services.query(query)
File "...path..\wmi.py", line 889, in query
return [ _wmi
Hello,
I'm occasionally receiving the following error when doing a set of queries:
Traceback (most recent call last):
File "psg5220_demo.py", line 236, in find_hdd_drives
partitions = services.query(query)
File "...path..\wmi.py", line 889, in query
return [ _wmi_object (obj, instance_o
Hello,
I'm occasionally receiving the following error when doing a set of queries:
Traceback (most recent call last):
File "psg5220_demo.py", line 236, in find_hdd_drives
partitions = services.query(query)
File "...path..\wmi.py", line 889, in query
return [ _wmi_object (obj, instance_o
lovely, thanks again.
On 26/03/2008, Tim Golden <[EMAIL PROTECTED]> wrote:
>
> mark.a.brand wrote:
> > what about events,
> >
> > for example i only want to return error and warning events for the last
> 4
> > days from all logs. getting all the events and then filtering them will
> be
> > terrri
mark.a.brand wrote:
> what about events,
>
> for example i only want to return error and warning events for the last 4
> days from all logs. getting all the events and then filtering them will be
> terrribly slow.
You let WMI do the filtering. For this, since it's a non-equi
filter (you want the
hi tim:
what about events,
for example i only want to return error and warning events for the last 4
days from all logs. getting all the events and then filtering them will be
terrribly slow.
cheers
mark
On 26/03/2008, Tim Golden <[EMAIL PROTECTED]> wrote:
>
> mark.a.brand wrote:
> > thanks t
Tim Golden wrote:
[... snip other examples ...]
> Even that is a slight optimisation. It usually costs little
> to pull back all the fields, so I generally write:
>
>
> import wmi
>
> c = wmi.WMI ()
> for service in c.Win32_Service (state="Stopped"):
>print c.Caption, c.Status
>
>
Sorr
mark.a.brand wrote:
> 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 stop
mark.a.brand wrote:
> 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 stop
mark.a.brand wrote:
> 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 stop
ve 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
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
13 matches
Mail list logo