{Spam?} Re: [Tutor] Regedit

Ali Polatel alipolatel at yahoo.com
Sun Oct 3 17:44:22 CEST 2004


ok some questions on Killkey
 

import win32apiimport win32condef KillKey(ParentKeyHandle,KeyName):    KeyHandle = win32api.RegOpenKeyEx(ParentKeyHandle,KeyName,        win32con.KEY_ALL_ACCESS)    while 1:        try:            # We always retrieve sub-key number 0, because            # when we delete a subkey, the old subkey #1            # becomes #0:            SubKeyName = win32api.RegEnumKey(KeyHandle,0)        except:            break        KillKey(KeyHandle,SubKeyName)    print "Deleting",KeyName    win32api.RegDeleteKey(ParentKeyHandle, KeyName)# Create some keys:RootKey=win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE,    "SYSTEM",win32con.KEY_ALL_ACCESS)win32api.RegCreateKey(RootKey,"Junk")win32api.RegCreateKey(RootKey,"Junk\\Stuff")win32api.RegCreateKey(RootKey,"Junk\\Stuff\\Wooble")win32api.RegCreateKey(RootKey,"Junk\\Stuff\\Weeble")win32api.RegCreateKey(RootKey,"Junk\\More stuff")# Delete all the keys:KillKey(RootKey,"Junk")

I have some problems modifiying it...

"RootKey=win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE,    "SYSTEM",win32con.KEY_ALL_ACCESS)" 

I want to go to HKEY_LOCAL_MACHINE-->Microsoft-->Windows-->CurrentVersion

-->Run

how to change this rootkey item to do that?

and then I want to create a value like for example:

"yahoomsn"="c:\yahoomessenger.exe"

how to do that?

Thanks and Regards,

Ali Polatel

 


		
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20041003/23b1e62f/attachment.htm


More information about the Tutor mailing list