title: Clean up output of my script (netsh interfaces list)
body: <p>My company does not use DHCP for the computers of the employees, so I have to type everything in manually. So I thought it would be nice to write a simple script for this.</p>
  <p>The problem is to specify the interface I want to configure. I want a little menu where I can simply select the device. The menu actually works, but the problem is that there are unnecessary spaces at the end I do not get rid off..</p>
  <p>(<code>%IP%</code> and <code>%Gateway%</code> are defined in other logic..)</p>
  <p>This is what I currently have:</p>
  <pre><code>@setlocal enableextensions enabledelayedexpansion
  set /P Gateway=&quot;Welcher Gateway? &quot;
  set /P IP=&quot;Welche IP? &quot;
  echo --------------------------------
  echo NR. Schnittstellenname
  echo --------------------------------
  SET countST=1
  for /f &quot;tokens=4-10&quot; %%a in ('netsh interface show interface') do (
      echo !countST!.  %%a %%b %%c %%d %%e
      set /a countST+=1
      )
  SET /P numberST=&quot;Welche Schnittstelle soll konfiguriert werden? (NR) &quot;
  SET countST=1
  for /f &quot;tokens=4-10&quot; %%a in ('netsh interface show interface') do (
      if !countST!==%numberST% (
          set ST=&quot;%%a %%b %%c %%d %%e&quot;
          )
      set /a countST+=1
      )
  echo %ST%
  netsh interface ipv4 set address name=%ST% static %IP% 255.255.255.0 %Gateway% store=persistent
  netsh interface ipv4 set dnsservers name=%ST% source=static address=&quot;8.8.8.8&quot; validate=no
  netsh interface ipv4 add dnsservers name=%ST% address=&quot;1.1.1.1&quot; validate=no index=2
  PAUSE
  endlocal
  
  </code></pre>