回复 3# wodekao - @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in (dns.txt) do set/a n+=1
- set/a nn=%random%%%!n!+1
- set n=
- for /f "delims=" %%a in (dns.txt) do (
- set/a n+=1
- if "n"=="nn" set nnn=%%a&&goto :n
- )
- :n
- netsh interface ip delete dnsservers "以太网" all
- netsh interface ip set dns "以太网" static %nnn% primary
- pause
复制代码
|