title: Batch File - Connect network drives with for loop
body: <p>I would like to create a batch file to easily connect to some network drives. I was thinking of using some kind of nested for loop but I'm a bit stuck. So I have two variables:</p>
  
  <pre><code>set drives=F,G,H
  set paths=LOCATION01\name1,LOCATION02\name1,LOCATION01\name2
  </code></pre>
  
  <p>Now I would like to be able to echo them like this: (well, instead of echo it, I will connect the right path to the right drive, but that doesn't matter here)</p>
  
  <pre><code>F -&gt; LOCATION01\name1
  G -&gt; LOCATION02\name1
  H -&gt; LOCATION01\name2
  </code></pre>
  
  <p>I'm not sure of how to solve this one. At first I tried something like the following, but that sure didn't work. It just looped through every path for every drive and I just want one path per drive.</p>
  
  <pre><code>FOR %%A IN (%drives%) DO FOR %%B IN (%paths%) DO ECHO %%A %%B
  </code></pre>
  
  <p>So... Any suggestions? Thanks!</p>