Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #88550

Re: Python library - WMI.py RegistryValueChangeEvent

References <02021a54-2770-4072-808a-75bea346051d@googlegroups.com>
Date 2015-04-07 09:49 +1000
Subject Re: Python library - WMI.py RegistryValueChangeEvent
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.74.1428364205.12925.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Apr 7, 2015 at 8:02 AM, Khyati <shrivastavkhyati@gmail.com> wrote:
> I have a question about RegistryValueChangeEvent that I have not been able to find an answer to on the internet so far. I would appreciate any help since I have already spent a lot of time finding any material that explains this:
>
> What I am trying to do:
> - create an event when a value for a registry key changes

Thanks for being clear about this part! Unfortunately, there are a few
other parts that aren't clear yet, so hopefully you can expand on your
question a bit.

> How I am doing it:
>>raw_wql = "SELECT * FROM RegistryValueChangeEvent WHERE Hive='HKEY_LOCAL_MACHINE' AND KeyPath='Software\\\\Temp' AND ValueName='Name\'"

Tip: Try adding "print(raw_wql)" just underneath this line, to see if
you're getting back what you really want. The backslash at the end of
ValueName is not currently doing anything.

>>watcher = c.watch_for(raw_wql=raw_wql,wmi_class = "__ExtrinsicEvent")
>>while TRUE:
>>    process_created = watcher()

This code isn't complete. Can you post a complete (and minimal)
example piece of code?

> Problem:
> the _wmi_event object returned is not coming back as Extrinsic event -
> So, in wmi.py, in class _wmi_watcher:
>    "self.is_extrinsic" returns false and I get an exception from the else part - [line 1186 - 1195]

It'd help hugely if you could post the entire traceback here - what
exception you're getting, and the exact lines that produce it.

> What I need
> - Any reference/idea/explanation on => why does RegistryValueChangeEvent returns as a Non-Extrinsic  event? even though it has been derived from __ExtrinsicEvent
>
> Other information:
> Running on Windows 8 64 Bit
>>>> platform.machine()
> 'AMD64'
>>>> platform.architecture()
> ('64bit', 'WindowsPE')
>>>> platform.python_version()
> '2.7.8'
>>>> platform.python_implementation()
> 'CPython'
>
> Using WMI-1.4.9.win32 - downloaded via PIP
> pywin32-219.win-amd64-py2.7

Just for reference, this is a general Python discussion list. Lots of
us won't know specific libraries, so all we can offer is fairly
general information. If you can't get the help you need here, you may
do better to look for more specific help about this module.

All the best!

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python library - WMI.py RegistryValueChangeEvent Khyati <shrivastavkhyati@gmail.com> - 2015-04-06 15:02 -0700
  Re: Python library - WMI.py RegistryValueChangeEvent Chris Angelico <rosuav@gmail.com> - 2015-04-07 09:49 +1000
    Re: Python library - WMI.py RegistryValueChangeEvent Khyati <shrivastavkhyati@gmail.com> - 2015-04-07 07:15 -0700
      Re: Python library - WMI.py RegistryValueChangeEvent Chris Angelico <rosuav@gmail.com> - 2015-04-08 00:31 +1000
        Re: Python library - WMI.py RegistryValueChangeEvent Khyati <shrivastavkhyati@gmail.com> - 2015-04-07 07:35 -0700
          Re: Python library - WMI.py RegistryValueChangeEvent Tim Golden <mail@timgolden.me.uk> - 2015-04-07 15:52 +0100
          Re: Python library - WMI.py RegistryValueChangeEvent Tim Golden <mail@timgolden.me.uk> - 2015-04-07 16:18 +0100
            Re: Python library - WMI.py RegistryValueChangeEvent Khyati <shrivastavkhyati@gmail.com> - 2015-04-07 08:30 -0700
              Re: Python library - WMI.py RegistryValueChangeEvent Khyati <shrivastavkhyati@gmail.com> - 2015-04-07 09:00 -0700

csiph-web