I am using the follow script to change my IP info.
I would like to get the name of the existing network adapter, set a variable with that name and replace name="Local Area Connection" with something like name=%nicName%
How can I do this?
REM ***** Change IP back to DHCP ******
ECHO Setting IP Address and Subnet Mask
netsh interface ip set address name="Local Area Connection" source=dhcp
ECHO Setting Primary DNS
netsh int ip set dns name="Local Area Connection" static 10.0.1.1
ECHO Setting Secondary DNS
netsh int ip add dns name=Local Area Connection" 10.0.1.2 index=2
ECHO Setting WINS to DHCP
netsh int ip set wins name="Local Area Connection" source=dhcp
ECHO Here are the new settings for %computername%:
netsh int ip show config