ip地址-自动获取- @ECHO off
-
- echo 65001编码获取: > nul
- chcp 65001 >nul
-
- :Netsh_Interface_Show_Interface
- set "Netsh_N="&&for /f "skip=3 tokens=1-3,* delims= " %%w in ('"Netsh.exe Interface Show Interface"')do set/a "Netsh_N+=1"&&for /f %%n in ('"call echo,%%Netsh_N%%"')do set "Netsh_Connect_%%n=%%w %%x %%y %%z"
- for /f "tokens=1,* delims==" %%i in ('set Netsh_Connect_')do for /f "tokens=1-3,* delims= " %%w in ("%%j")do (
- Netsh.exe interface Ip Set Address Name="%%z" Source=dhcp
- Netsh.exe interface Ip Set DnsServers Name="%%z" Source=dhcp
- )
- pause
- ipconfig /renew & cls & ipconfig /flushdns & cls
-
- goto:eof
复制代码
|