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

command linepermissionswindowswindows 10windows-registry

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"

Best Answer

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.

==>