solved it!
I need to close the key first
import ntsecuritycon
import win32security
import win32api
import _winreg
import win32con
flags = ntsecuritycon.TOKEN_ADJUST_PRIVILEGES |
ntsecuritycon.TOKEN_QUERY
htoken = win32security.OpenProcessToken(win32api.GetCurrentProcess(),
flags)
Loadid = win32s
I've worked out that I can open and close the key fine if I don't open
a subkey. I've tried adding flush and close statements after opening
the key and still get access denied when trying to unload.
--
http://mail.python.org/mailman/listinfo/python-list
In the following script I can't get the reg key to unload. Anyone got
any ideas? I can load and save the key without any problems. I can
unload the key from regedit and have checked security on the key. The
docs don't mention any special privileges are needed
(SeRestorePrivilege should do it).