title: Searching For A Registry Value Then Change It
body: <p>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:</p>
  
  <ul>
  <li>HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture\RANDOM_STRING\Properties</li>
  <li>HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\RANDOM_STRING\Properties</li>
  </ul>
  
  <p>Within each of these keys (1st one is for Mics and 2nd is for Speakers) their are the two DWORD-32 values in each:</p>
  
  <ul>
  <li>{b3f8fa53-0004-438e-9003-51a46e139bfc},3</li>
  <li>{b3f8fa53-0004-438e-9003-51a46e139bfc},4</li>
  </ul>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>An example of the process I'd like (or again, something else similar):</p>
  
  <ul>
  <li>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.</li>
  <li>Set the value of the DWORD-32 value
  "{b3f8fa53-0004-438e-9003-51a46e139bfc},3" to 0.</li>
  <li>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.</li>
  <li>Set the value of the DWORD-32 value
  "{b3f8fa53-0004-438e-9003-51a46e139bfc},4" to 0.</li>
  </ul>