Is there a way to check whether the current user can write to the registry? More specifically if it's not an administrator, can it write to HKEY_LOCAL_MACHINE or the policy keys on HKEY_CURRENT_USER.
I tried with LookupPrivilegeValue() but I don't think it's the right thing to do.
Code is appreciated.
Theres one really simple and reliable way to see if the user has write access to a registry key:-
LONG err = RegOpenKeyEx(....,KEY_READ|KEY_WRITE);
if(err) {
// Test err to see if its a permission error. if so, the user does not have permission.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With