windows下自动设置IP地址批处理 脚本

以下是我电脑上的自动设置脚本:

有线网络设置.bat

@echo off
echo       Malu.me有线网络设置
echo Is now setup wiress IP
echo ipaddress:172.21.1.197
echo netmask:255.255.0.0
echo gateway:172.21.1.1
echo ....
netsh interface ip set address name="本地连接" source=static 172.21.1.197 255.255.0.0 172.21.1.1 auto
echo Is now steup DNS
echo DNS:172.21.1.1
echo ....
netsh interface ip set dns name="本地连接" source=static 172.21.1.1
ping 172.21.1.1
exit

把无线网络设置成自动.bat

@echo off
echo 把无线网络设置成自动
echo ....
netsh interface ip set address name="无线网络连接" source=dhcp
exit

无线网络设置成静态.bat

@echo off
echo       Malu.me无线网络设置(按回车开始)
pause >nul
echo Is now setup wiress IP
echo ipaddress:172.21.1.197
echo netmask:255.255.0.0
echo gateway:172.21.1.1
echo ....
netsh interface ip set address name="无线网络连接" source=static 172.21.1.197 255.255.0.0 172.21.1.1 auto
echo Is now steup DNS
echo DNS:172.21.1.1
echo ....
netsh interface ip set dns name="无线网络连接" source=static 172.21.1.1
ping 172.21.1.1
Echo 按任意键退出
pause >nul
exit

为无线网络添加2个子IP.bat

@echo off
echo 设置两个子IP
echo IP1:192.168.0.222/24
echo IP2:10.0.0.222/8
echo ....
netsh interface ip add address "无线网络连接" 192.168.0.222 255.255.255.0
netsh interface ip add address "无线网络连接" 10.0.0.222 255.0.0.0
echo OK
exit
此条目是由 malu8 发表在 未分类 分类目录的。将固定链接加入收藏夹。

评论已关闭。