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.