Changing Registry Settings with Ansible Windows 10

I've been trying to disable a microphone via automation for a few days now. I'm using Ansible and attempting to change the registry setting. It's a simple thing changing from 10000000 to 10000001 or 128 to 129. I've attempted the following:

-name: disable mic
win_regedit:
path: HKLM:\path to registry
name: DeviceState
value: 129
(also have used data and type but none of that worked)


Here I get that I cannot access the registry. So I gave win_regmerge a shot:

-name: disable mic
win_regmerge:
path: C:\path\to-my-working-reg-file


Again on this I get a Error accessing the registry. Am I just screwed and unable to run these registry changes. I'm running as adminstrator. I'm not sure what else to do here. Any help would be appreciated. p.s. I've attempted using powershell with the reg file and it says it's not a cmdlet. I've made a batch file to run the reg file but it just spins as it's waiting for admin confirmation. when using powershell I can use -confirm: \$false not an option with the bat file. The only other thing I could think of was to run a bat file, of a powershell file of the .reg file...but that's kind of ridiculous & probably won't work.

• Have you try to modify the value just by the regedit.exe? can it work? or any similar error? – OOOO Aug 1 '18 at 2:08
• Yes I simply change the registry setting and created a file via export. I can double click on it and it does what it is supposed to do. But I haven't changed it into an exe file or anything like that. – Psyllex Aug 1 '18 at 17:06
• Provide the registry path. Same question? stackoverflow.com/questions/51548222 – Biswapriyo Aug 2 '18 at 19:59
• @Biswapriyo I used HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture\{a whole lotta numbers and letters} – Psyllex Aug 6 '18 at 21:43