title: Batch file to delete multiple values within a key in Registry
body: <p>The following key had multiple values like "Find", "Find 0", Find 1", "Find 2" and so on.
  HKCU\Software\Microsoft\VisualStudio\9.0\Find</p>
  
  <p>The values increase with use and I have no prior knowledge of the maximum number.
  Goal is to create a batch file to delete all the "Find *" values without knowing the maximum value beforehand.</p>
  
  <p>I tried the following with max number = 10:</p>
  
  <pre><code>@ECHO OFF
  FOR /L %%G IN (0,1,10) DO REG DELETE HKCU\Software\Microsoft\VisualStudio\9.0\Find /v "Find %%G" /f
  PAUSE
  </code></pre>
  
  <p>How do I loop till the max number if I don't have an idea about it?</p>
  
  <p>I could put a large number like 100 and loop it through. But that would be unnecessary looping. </p>
  
  <p>Idea:</p>
  
  <p>After it reaches the max number it throws out an error in the console </p>
  
  <pre><code>"Error:  The system was unable to find the specified registry key or value"
  </code></pre>
  
  <p>I would like to capture this in a variable and check for the string "Error ...." and if true, terminate the loop.
  I have no idea how to do this.</p>