批处理 ip设置

来源:互联网 发布:c语言中continue的用法 编辑:程序博客网 时间:2024/06/15 08:42

@echo off
echo 开始设置本机网络地址!

echo 正在设置本机IP ,请稍等......
netsh interface ip set address "本地连接" source = static addr = 192.168.203.66 mask=255.255.255.0
echo 正在设置本机网关,请稍等......
netsh interface ip set address "本地连接" gateway = 192.168.203.1 gwmetric =1
echo 正在设置本机DNS ,请稍等......
netsh interface ip set dns "本地连接" source = static addr = 202.197.64.6
echo 正在设置备用DNS ,请稍等......
netsh interface ip add dns "本地连接" addr=202.197.64.6
echo 设置完成!