1

On all the Windows 10 computers I re-image, I want to disable the option in Sound for giving exclusive control to each device to applications. I have located the registry keys and values:

  • HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture\RANDOM_STRING\Properties
  • HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\RANDOM_STRING\Properties

Within each of these keys (1st one is for Mics and 2nd is for Speakers) their are the two DWORD-32 values in each:

  • {b3f8fa53-0004-438e-9003-51a46e139bfc},3
  • {b3f8fa53-0004-438e-9003-51a46e139bfc},4

I want to basically make a batch script that will find these two values and set them to 0 for each audio devices. I'll have it run via Task Scheduler or something to make sure it gets new devices too.

The problem for me is that RANDOM_STRING portion of each path. Each one is ~25 random characters; it looks similar to the value names with the ,# at the end. I know how to change a value via a specific path, but here their is that randomized key name, and then new ones as new devices are plugged in.

Is their any way for me to create a batch file (or VBS/PowerShell) that will search the registry (or just Audio to narrow it down quicker) for those two values, and change their values to 0? Or if any other ways of going about this if so?

An example of the process I'd like (or again, something else similar):

  • Search for the DWORD-32 value "{b3f8fa53-0004-438e-9003-51a46e139bfc},3" within the path "HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\" and all the sub-keys within.
  • Set the value of the DWORD-32 value "{b3f8fa53-0004-438e-9003-51a46e139bfc},3" to 0.
  • Search for the DWORD-32 value "{b3f8fa53-0004-438e-9003-51a46e139bfc},4" within the path "HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\" and all the sub-keys within.
  • Set the value of the DWORD-32 value "{b3f8fa53-0004-438e-9003-51a46e139bfc},4" to 0.
  • You could take a look at REG ADD batch command for changing the value - https://technet.microsoft.com/en-us/library/cc742162(v=ws.11).aspx – Franko Leon Tokalić Jul 29 '16 at 13:07
  • 1
    Those are not *random strings*. They're GUIDs. Hacking away at values in the registry you don't understand is a really good way to brick your computer. – Ken White Jul 29 '16 at 14:04

2 Answers2

1

I hope you know what are you doing. Manipulating registry is very risky. If you are absolutely sure, take a look at this script:

ls 'HKLM:\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture\*\Properties\' | `
    where {$_.Property -contains '{b3f8fa53-0004-438e-9003-51a46e139bfc},3'} | `
    Get-ItemProperty -Name '{b3f8fa53-0004-438e-9003-51a46e139bfc},3'
    #Set-ItemProperty -Name '{b3f8fa53-0004-438e-9003-51a46e139bfc},3' -Value 0

Make sure this script (with Get-ItemProperty) gets only desired keys. To change values, replace last line with commented one. Make sure you have proper permissions. And finally: do it at you own risk :)

Paweł Dyl
  • 8,888
  • 1
  • 11
  • 27
0

I was unable to get the other answer working. I am trying to ban the Netflix app from being unbearably loud (which it does if it gets exclusive control of the sound device) every time I reinstall the geforce drivers (when the exclusive control resets).

So:

Get-ChildItem -recurse -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\'| `
Foreach-Object { if ($_.Property -eq '{b3f8fa53-0004-438e-9003-51a46e139bfc},3') {$_|Get-ItemProperty -Name  '{b3f8fa53-0004-438e-9003-51a46e139bfc},3'} }`

Gives me this output:

{b3f8fa53-0004-438e-9003-51a46e139bfc},3 : 0
PSPath                                   : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
                                           Windows\CurrentVersion\MMDevices\Audio\Render\{94743724-8af1-4abc-8d45-275
                                           7184ec5f2}\Properties
PSParentPath                             : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
                                           Windows\CurrentVersion\MMDevices\Audio\Render\{94743724-8af1-4abc-8d45-275
                                           7184ec5f2}
PSChildName                              : Properties
PSProvider                               : Microsoft.PowerShell.Core\Registry

{b3f8fa53-0004-438e-9003-51a46e139bfc},3 : 0
PSPath                                   : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
                                           Windows\CurrentVersion\MMDevices\Audio\Render\{b4ed07ae-0ee7-4ffb-8370-8bb
                                           08a59a941}\Properties
PSParentPath                             : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
                                           Windows\CurrentVersion\MMDevices\Audio\Render\{b4ed07ae-0ee7-4ffb-8370-8bb
                                           08a59a941}
PSChildName                              : Properties
PSProvider                               : Microsoft.PowerShell.Core\Registry

This looks good.

To write it the Get-ItemProperty needs to change to Set-ItemProperty but it results in a security error, please consult https://stackoverflow.com/a/35844259/308851 to take ownership of the relevant key.

chx
  • 11,270
  • 7
  • 55
  • 129