title: Windows batch file for iterative invocation of other batch files
body: <p>Consider a directory structure containing the following files:</p>
  
  <pre><code>\1.3\Baseline\GeneratedScripts\One\FullInstall.cmd
  \1.3\Baseline\GeneratedScripts\Two\FullInstall.cmd
  \1.3\Baseline\GeneratedScripts\Three\FullInstall.cmd
  \1.3\Patches\Patch1\GeneratedScripts\One\FullInstall.cmd
  \1.3\Patches\Patch1\GeneratedScripts\Two\FullInstall.cmd
  \1.3\Patches\Patch1\GeneratedScripts\Three\FullInstall.cmd
  \1.3\Patches\Patch2\GeneratedScripts\One\FullInstall.cmd
  \1.3\Patches\Patch2\GeneratedScripts\Two\FullInstall.cmd
  \1.3\Patches\Patch2\GeneratedScripts\Three\FullInstall.cmd
  \1.3\Patches\Patch3\GeneratedScripts\One\FullInstall.cmd
  \1.3\Patches\Patch3\GeneratedScripts\Two\FullInstall.cmd
  \1.3\Patches\Patch3\GeneratedScripts\Three\FullInstall.cmd
  </code></pre>
  
  <p>I would like to construct a Windows batch file <code>InstallEnvironment.cmd</code> which:</p>
  
  <ol>
  <li>Takes an environment name as a parameter; then</li>
  <li>Executes the baseline install script, and each of the patch scripts in turn.</li>
  </ol>
  
  <p><em>The batch file should automatically execute any additional patches that are added later.</em></p>
  
  <p>Essentially I need to do something along the lines of this:</p>
  
  <pre><code>for %%_ in (1.3\**\GeneratedScripts\%%1\FullInstall.cmd) do cal %%_
  </code></pre>
  
  <p>However I'm not sure the wildcard system is rich enough to allow this as I don't get any matches for the <code>**</code> directory wildcard.</p>
  
  <p><strong>For example</strong>, calling with the parameter "Two" should execute the following scripts, in order:</p>
  
  <pre><code>\1.3\Baseline\GeneratedScripts\Two\FullInstall.cmd
  \1.3\Patches\Patch1\GeneratedScripts\Two\FullInstall.cmd
  \1.3\Patches\Patch2\GeneratedScripts\Two\FullInstall.cmd
  \1.3\Patches\Patch3\GeneratedScripts\Two\FullInstall.cmd
  </code></pre>