@echo off
netsh interface show interface | find "本地连接" && echo 本地连接>>1.txt || echo 本地连接未启用 & netsh interface show interface | find "无线网络连接" && echo 无线网络连接>>1.txt || echo 无线网络连接已禁用
echo 当前正在使用:
for /f %%c in (1.txt) do @(
echo %%c
)
del 1.txt /Q
pause
这是获取网卡作者: JC_2019 时间: 2021-4-8 14:27
@echo off
::ip
ipconfig/all
netsh interface ip set address "本地连接" static 192.168.137.118 255.255.255.0 192.168.137.1 1
::dns
netsh -c interface ip set dns name="本地连接" source=static addr=223.5.5.5 register=PRIMARY"
::netsh interface ip set address name="本地连接" source=static addr=21.5.251.63 mask=255.255.0.0 gateway=21.5.251.254 gwmetric=1