First of all, I have read countless forum topics, and no luck. I'm trying to write to:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\{00000000-0000-0000-0000-000000000000}\FxProperties]
(zeroes are random number which my script determines and replaces).
I've tried to import REG file. I've tried to use RegWrite. I've tried to add #RequireAdmin to my script. I've compiled script to EXE and added admin manifest. I've turned off UAC. And still I can't write there.
Yet when I double click REG file, everything is importing properly.
It seems my script is lacking some permissions, but with all I have already tried - I have no idea just what the hell else does Windows 7 want. Anyone has any idea? And more importantly - how can I add it to my script.
My script (the ONLY problematic part is the very bottom line):
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\{00000000-0000-0000-0000-000000000000}\FxProperties]
(zeroes are random number which my script determines and replaces).
I've tried to import REG file. I've tried to use RegWrite. I've tried to add #RequireAdmin to my script. I've compiled script to EXE and added admin manifest. I've turned off UAC. And still I can't write there.
Yet when I double click REG file, everything is importing properly.
It seems my script is lacking some permissions, but with all I have already tried - I have no idea just what the hell else does Windows 7 want. Anyone has any idea? And more importantly - how can I add it to my script.
My script (the ONLY problematic part is the very bottom line):
[ autoit ]
#notrayicon #Include <_RegSearch.au3> $s = _RegSearchValue("Realtek System Effect", "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render", 0, 0) If $s = "" Then $s = _RegSearchValue("Realtek System Effect", "HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render", 0, 0) EndIf $stripped = StringReplace($s, "\FxProperties", "") $pos1 = StringInStr($stripped,@CRLF,0,-1) $1 = StringTrimRight($stripped,StringLen($stripped) - $pos1) $pos2 = StringInStr($1,'}',0,-2) $2 = StringTrimRight($1,StringLen($1) - $pos2) $pos3 = StringInStr($stripped,@CRLF,0,-1) $3 = StringTrimLeft($stripped,StringLen($stripped) - $pos3) $pos4 = StringInStr($3,'}',0,-2) $4 = StringTrimRight($3,StringLen($3) - $pos4) FileCopy(@ScriptDir & '\Data\Equalizer.reg', @TempDir & '\Equalizer.reg', 1) $szFile = (@TempDir & '\Equalizer.reg') $szText = FileRead($szFile,FileGetSize($szFile)) $szText = StringReplace($szText, "{00000000-0000-0000-0000-000000000000}", $2, 1) $szText = StringReplace($szText, "{00000000-0000-0000-0000-000000000000}", $4, 2) FileDelete($szFile) FileWrite($szFile,$szText) Run("REGEDIT /S " & @TempDir & "\Equalizer.reg")