
CODE: [Copy to clipboard]自动切换网关自己能搞定不?@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
)
)
CODE: [Copy to clipboard]@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
)
)
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |