联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off for /f "tokens=16 delims= " %%a in ('ipconfig /all^|findstr /c:"Host Name"') do ( if %%a leq 13 ( echo 计算机名称1-13 ) else if %%a leq 26 ( echo 计算机名称14-26 ) else ( echo 计算机名称27-39 ) )
@echo off for /f "tokens=16 delims= " %%a in ('ipconfig /all^|findstr /c:"Host Name"') do ( if %%a leq 13 ( netsh interface ip set address name="本地连接" source=static gateway=192.168.1.252 gwmetric=1 ) else if %%a leq 26 ( netsh interface ip set address name="本地连接" source=static gateway=192.168.1.253 gwmetric=1 ) else ( netsh interface ip set address name="本地连接" source=static gateway=192.168.1.254 gwmetric=1 ) )