Run as administrator, but still "requested registry access is not allowed"

powershell

Solution

If you run regedit and navigate to the key that you are trying to access with your script, you can right click on it and view the permissions. You can see on that key what permissions Administrator has (Full Control, Read, Special Permissions)

Problem

I have a Windows PowerShell script. I logged into Windows as an administrator and run the script with PowerShell running as an administrator, and it worked; I could see all the changes happen after running this script. But I still get the red error message: requested registry access is not allowed which is driving me nuts. Why am I getting this error and how can I make it go away?

Original source

Related problems