Access denied when modifing value of registry key [run as admin & owner of key]

0

So i found out that i cant really modify value of the registry , whatever i do with my permissions i cant get it to work from command line (I need to do this from command line since i want to use other program to execute this) I do succeed when i try to manually change value from regedit window.

Image

enter image description here

I run on windows 10 64bit , im the owner of the key with full permissions and administrator on this account.

Any idea why i get Access denied? I cant seem to figure this out.

Command :

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render{d348b8e8-3118-4a9c-9b43-422647b555ca}\FxProperties /f /v "{E0A941A0-88A2-4df5-8D6B-DD20BB06E8FB},4" /t REG_DWORD /d "1"

Tomas Bisciak

Posted 2016-04-22T21:23:46.087

Reputation: 113

The value already exists? Have you tried deleting it first then adding it? – DavidPostill – 2016-04-22T21:34:02.333

@DavidPostill Value exists already, im looking to overwrite it - parameter /f forces it to overwrite , based on http://superuser.com/questions/607572/how-do-i-modify-the-data-of-an-existing-registry-key-value-name-from-cmd .Havent tryed to delete anything, bud is that really reason to throw access denied?

– Tomas Bisciak – 2016-04-22T21:38:09.130

I know about /f. I was curious if you get the same error trying to delete it. – DavidPostill – 2016-04-22T21:39:42.380

@DavidPostill No idea, im scared to delete this value (cant restart this system atm) , its system value and i dont wanna mess up my audio , its value for Loudness equalization. 1 enabled , 0 disabled – Tomas Bisciak – 2016-04-22T21:40:43.020

put the reg add code in a text file, then change the extension to .reg, then right click on it and select Merge, does it work? – Moab – 2016-04-23T00:17:30.923

Answers

1

There is a little typo: double quote missing:

reg add "HKLM\ … \FxProperties  /f /v …
                              |<-------- here
reg add "HKLM\ … \FxProperties" /f /v …

For a wonder, reg query and reg add raise another error in case of such simple syntax mistake:

==> reg query "HKLM\SOFTWARE\Test Key /v "{testval},1"
ERROR: The system was unable to find the specified registry key or value.

==> reg query "HKLM\SOFTWARE\Test Key" /v "{testval},1"

HKEY_LOCAL_MACHINE\SOFTWARE\Test Key
    {testval},1    REG_DWORD    0x1


==> reg add "HKLM\SOFTWARE\Test Key /f /v "{testval},1"  /t REG_DWORD /d "1"
ERROR: Access is denied.

==> reg add "HKLM\SOFTWARE\Test Key" /f /v "{testval},1"  /t REG_DWORD /d "1"
The operation completed successfully.

==>

JosefZ

Posted 2016-04-22T21:23:46.087

Reputation: 9 121

Yes that and one other typo i had in the key "path" was the cause i got that error, too bad the error name didnt really helped me to realize that :) thanks JosefZ. – Tomas Bisciak – 2016-04-24T08:50:59.797