Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.032 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'subject:Python': 0.06; 'problem:': 0.07; 'derived': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'changes': 0.15; 'windows': 0.15; "'cpython'": 0.16; 'backslash': 0.16; 'bit.': 0.16; 'code?': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:library': 0.16; 'true:': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'discussion': 0.18; 'bit': 0.19; 'trying': 0.19; 'example': 0.22; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'fairly': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'this:': 0.26; 'post': 0.26; 'downloaded': 0.26; 'header:In-Reply-To:1': 0.27; 'skip:p 30': 0.29; 'am,': 0.29; 'returned': 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'getting': 0.31; 'lines': 0.31; '>>>>': 0.31; 'piece': 0.31; 'class': 0.32; 'skip:c 30': 0.32; 'running': 0.33; 'skip:_ 10': 0.34; 'could': 0.34; "can't": 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'complete.': 0.36; 'explains': 0.36; 'false': 0.36; 'module.': 0.36; 'doing': 0.36; 'material': 0.36; 'thanks': 0.36; 'so,': 0.37; 'list.': 0.37; 'clear': 0.37; 'being': 0.38; 'does': 0.39; 'skip:p 20': 0.39; 'how': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'entire': 0.61; "you're": 0.61; 'back': 0.62; 'offer': 0.62; 'complete': 0.62; 'skip:n 10': 0.64; 'more': 0.64; 'here': 0.66; 'anything.': 0.68; 'line,': 0.68; 'internet': 0.71; 'information:': 0.72; '2015': 0.84; "it'd": 0.84; 'underneath': 0.84; 'do:': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=WjQuJjvTd6BdgFiSl01Zgo2OefdTL+N9C2IHHnahjjA=; b=SKlge9+Fc9quSqOWQy1KfE5JfhKxvn8jbrHmgXjm/OnVBoP8zzt+iuyFOUb8CtMvn4 3sGeIXIDYxBzupN/Te+Vzilh/MijOq6PkoUl+0fV2/ItXSPv8kqV/i6DdPpiN05u3fa+ omMJrsHLqmOyvb6S6W85TTm4BzMPGdXR0B05LK4SaVk0wucROxHsaVGcZ7DJ8rXoLO8M xFXAOhqeWDW56edpo5Df6bdI9/6bXf2Xr8k7UR9JBMufy5DuSe4SP1fIlha1v4PiIM6U ogdu650NBxn+7dqLt8OuhiwE8xjCiKjH3QwVHQsuiJfsRhxxRRhtoU5vDBCbMoRbmL/C tc6g== MIME-Version: 1.0 X-Received: by 10.50.43.197 with SMTP id y5mr1220050igl.14.1428364197102; Mon, 06 Apr 2015 16:49:57 -0700 (PDT) In-Reply-To: <02021a54-2770-4072-808a-75bea346051d@googlegroups.com> References: <02021a54-2770-4072-808a-75bea346051d@googlegroups.com> Date: Tue, 7 Apr 2015 09:49:57 +1000 Subject: Re: Python library - WMI.py RegistryValueChangeEvent From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 57 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1428364205 news.xs4all.nl 2935 [2001:888:2000:d::a6]:40913 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 6078 X-Received-Body-CRC: 2150038405 Xref: csiph.com comp.lang.python:88550 On Tue, Apr 7, 2015 at 8:02 AM, Khyati 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