Re: Scanning through Windows registry...

2008-05-16 Thread Lie
On May 17, 2:06 am, Lie <[EMAIL PROTECTED]> wrote: > On May 9, 7:36 pm, Unknown Hero <[EMAIL PROTECTED]> wrote:> Ah, never mind, > got it to work. Here's the code now. I hope I won't > > run into another problems later :D > > > > > #Goes through all keys and subkeys in the selected hive (defined

Re: Scanning through Windows registry...

2008-05-16 Thread Lie
On May 9, 7:36 pm, Unknown Hero <[EMAIL PROTECTED]> wrote: > Ah, never mind, got it to work. Here's the code now. I hope I won't > run into another problems later :D > > > #Goes through all keys and subkeys in the selected hive (defined as > root) and replaces the value 'old' with the value 'new'

Re: Scanning through Windows registry...

2008-05-09 Thread Unknown Hero
Ah, never mind, got it to work. Here's the code now. I hope I won't run into another problems later :D #Goes through all keys and subkeys in the selected hive (defined as root) and replaces the value 'old' with the value 'new' # #IMPORTANT! You should always back up the registry before attemptin

Re: Scanning through Windows registry...

2008-05-09 Thread Unknown Hero
On 9 touko, 12:51, Unknown Hero <[EMAIL PROTECTED]> wrote: > Finally managed to get it to work (heh, I was pretty darn lost even > though I had the best help) but as promised, I'll post my code here > for those who might be interested in it. The biggest of thanks to Tim > Golden, who basically wal

Re: Scanning through Windows registry...

2008-05-09 Thread Unknown Hero
On 7 touko, 14:25, Unknown Hero <[EMAIL PROTECTED]> wrote: > I'll post my code here once I have time to write it, currently I'm > rather busy. That is merely for optimization suggestions and for > others who might need the same sort of code I did. > > Thank you once again. Finally managed to get i

Re: Scanning through Windows registry...

2008-05-07 Thread Mike Driscoll
On May 7, 9:19 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Mike Driscoll wrote: > > On May 7, 4:45 am, Tim Golden <[EMAIL PROTECTED]> wrote: > >> In a spirit of being helpful... :) > > [... snip registry walker ...] > > > This is pretty cool stuff, Tim. Of course, it would also seriously > > screw

Re: Scanning through Windows registry...

2008-05-07 Thread Tim Golden
Mike Driscoll wrote: On May 7, 4:45 am, Tim Golden <[EMAIL PROTECTED]> wrote: In a spirit of being helpful... :) [... snip registry walker ...] This is pretty cool stuff, Tim. Of course, it would also seriously screw up some programs if you decided to replace the wrong phrase. Just a word of

Re: Scanning through Windows registry...

2008-05-07 Thread Mike Driscoll
On May 7, 4:45 am, Tim Golden <[EMAIL PROTECTED]> wrote: > In a spirit of being helpful... :) > > The code below (which I imagine every Windows programmer writes > sometime in their Python life) mimics the os.walk functionality, yielding > the key, subkeys, and values under a particular starting po

Re: Scanning through Windows registry...

2008-05-07 Thread Unknown Hero
Thank you, I think I can manage now. It's nice that you could spare some time to help me in this, Tim. People like you make the world a better place :) I'll post my code here once I have time to write it, currently I'm rather busy. That is merely for optimization suggestions and for others who mig

Re: Scanning through Windows registry...

2008-05-07 Thread Tim Golden
In a spirit of being helpful... :) The code below (which I imagine every Windows programmer writes sometime in their Python life) mimics the os.walk functionality, yielding the key, subkeys, and values under a particular starting point in the registry. The "if __name__ == '__main__'" test run at

Re: Scanning through Windows registry...

2008-05-07 Thread Tim Golden
Unknown Hero wrote: Tim Golden wrote: [... snip long example ...] Correct me if I'm wrong (which I just might be), but doesn't the above code go through the keys behind HKEY_LOCAL_MACHINE\Software\Timsoft\ ? Is it possible to use an empty value in: hTimSoft = _winreg.OpenKey (HKLM, r"Soft

Re: Scanning through Windows registry...

2008-05-06 Thread Unknown Hero
Tim Golden wrote: > Well, I attach a kind of explanatory Noddy example I wrote a few years ago > for someone on the python-win32 list. I think, glancing over it, that it > includes > what you need to know, although not necessarily in the right order. I'm happy > to > explain if things aren't cle

Re: Scanning through Windows registry...

2008-05-06 Thread Tim Golden
Unknown Hero wrote: So basically I am looking for these things: 1) Read one subkey from HKEY_LOCAL_MACHINE at a time (I think QueryValueEx() is needed here) 2) Check if said subkey contains some predetermined string (like 'foo' here) 3) If the above applies, change the value into another predete

Re: Scanning through Windows registry...

2008-05-06 Thread Unknown Hero
Tim Golden wrote: > In a spirit of teaching people to fish... > > ... If you put something like "Python windows registry" into Google, you > get quite a few hits, the top one of which is probably pointing to the stdlib > _winreg module, but several others point towards wrapper classes, modules > et

Re: Scanning through Windows registry...

2008-05-06 Thread Tim Golden
Unknown Hero wrote: Hi everyone! Well, I have this need for a Python script that will scan through a selected hive (like HKEY_LOCAL_MACHINE) and replace all strings that contain word xxx (IE. foo) with yyy (IE. moo). I do not want partial results, but rather complete strings (no foome or the lik

Scanning through Windows registry...

2008-05-06 Thread Unknown Hero
Hi everyone! Well, I have this need for a Python script that will scan through a selected hive (like HKEY_LOCAL_MACHINE) and replace all strings that contain word xxx (IE. foo) with yyy (IE. moo). I do not want partial results, but rather complete strings (no foome or the like, just foo). I have