Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Get adapter name as variable

$
0
0

This batch file works, but the adapter name has to be hard coded, is there a way to put the name into a variable from netsh so that the code can be generic?

@echo off
echo Please wait ... Enabling adapter ...

netsh interface show interface name="Wi-Fi" | find /i "DISCONNECTED" >nul && netsh interface set interface "Wi-Fi" ENABLE"
netsh interface show interface name="Ethernet" | find /i "DISCONNECTED" >nul && netsh interface set interface "Ethernet" ENABLE"

echo Process completed
timeout /t 10


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>