| echo 正在为您设置IP,请稍等...... | | set /A "a=%RANDOM%%%250+3 | | set /A "b=%RANDOM%%%250+3 | | set /A "c=%RANDOM%%%250+3 | | netsh interface ip set address name="本地连接" source=static addr=10.%a%.%b%.%c% mask=255.0.0.0 | | :start | | set /A "num=%RANDOM%%%190+10" | | ping 10.1.1.%num% -n 1 | | | | %systemroot%\system32\arp.exe -a | %systemroot%\system32\find.exe "10.1.1.%num%" &&goto start | | netsh interface ip set address name="本地连接" source=static addr=10.1.1.%num% mask=255.255.255.0 gateway=10.1.1.250 gwmetric=0 | find "IP地址已在网络上使用" &&goto start | | netsh interface ip set dns "本地连接" source=static addr=10.1.1.100 register=primary | | netsh interface ip add dns "本地连接" addr=8.8.8.8 | | netsh interface ip set wins name="本地连接" source=static addr=10.1.1.100 | | if %errorlevel% neq 0 goto startCOPY |
如果仍然有问题,请把执行过程贴出来看看那。 |