title: Get MAC address and interface name of network card
body: <p>My workstation has a couple of network cards, which usually have default interface names like this: <em>local area connection</em>, <em>local area connection 2</em>, etc.</p>
  
  <p>It may be that network card 1 is named <em>local area connection 3</em>, network card 2 is named <em>local area connection</em> etc.</p>
  
  <p>I am trying to write a batch (preferred) or vbs script which does the following:</p>
  
  <ol>
  <li>Check, whether a specific network card is installed in the machine which has one of the MAC addresses of a predefined list</li>
  <li>Get the interface name of this network card</li>
  <li>Change the interface name of that network card</li>
  <li>Change the configuration of the network card (IP address, subnet mask)</li>
  </ol>
  
  <p>So far, I found out that I could change the interface name using the command line:</p>
  
  <pre><code>netsh interface set interface name="local area connection" newname="newNetworkName"
  </code></pre>
  
  <p>and that I could change the configuration using:</p>
  
  <pre><code>netsh int ip set address "local area connection" static 192.168.0.101 255.255.255.0 0.0.0.0
  </code></pre>
  
  <p>So the question now is how to realize step 1. and step 2.</p>
  
  <p>Any help is very appreciated.</p>