title: Toggle enable/disable Ethernet adapter from CMD
body: <p>I'm trying to create a <em>.bat</em> file which can enable/disable my ethernet adapter, but I don't have much knowledge about coding or the cmd syntax. I was thinking about using the <em>netsh</em> command in something like:</p>
  <pre><code>IF &quot; ~Ethernet adapter is enabled~ &quot; GOTO :disable ELSE GOTO :enable
  
  :disable
      netsh interface set interface &quot;Ethernet&quot; disabled
          
  :enable
      netsh interface set interface &quot;Ethernet&quot; enabled
      
  </code></pre>
  <p>How can I do it right?</p>