|
Does anyone have experience with the _winreg module? I'm trying to write a script that deletes a registry key in HKLM\Software\Classes\Installer\Products, however the _winreg DeleteKey method cannot delete keys with subkeys, which gives a WindowsError exception "Access is denied" error 5. The only solutions I could think of was to create a function that recursively deletes every subkey in the input key before deleting the primary key. I'm trying to do this remotely, so I have to be able to connect to a remote registry. Another solution was to call the reg command like: reg delete "\\\\%s1\\HKLM\Software\Classes\Installer\Products\%s2" Where %s1 is the computer and %s2 is the product key I'm trying to delete. Running this command produces a different error, "The procedure number is out of range." Running the same command on the local machine worked fine.
|
# ¿ Oct 4, 2012 15:24 |
|
|
# ¿ May 20, 2024 06:36 |
|
Sweet, thanks Gripper! That works exactly like I wanted it to. The only thing I changed was the key_str argument, instead I'm using:Python code:
Python code:
Kerpal fucked around with this message at 21:13 on Oct 4, 2012 |
# ¿ Oct 4, 2012 21:03 |