@echo off
set /p input=输入
set hostip=%input%
netsh interface ip set address "WLAN" static 192.168.2.%hostip% 255.255.255.0 192.168.2.1 1
netsh interface ip set dns "WLAN" static 202.96.128.86 primary
netsh interface ip add dns "WLAN" 202.96.128.86
说明
set /p input=输入
输入一个主机位的ip
set hostip=%input%
变量hostip赋值,引用input
netsh interface ip set address "WLAN" static 192.168.2.%hostip% 255.255.255.0 192.168.2.1 1
设置ip地址、子网掩码、网关、跳跃数
"WLAN” 网卡名称
%hostip% 引用变量
netsh interface ip set dns "WLAN" static 202.96.128.86 primary
设置主dns
netsh interface ip add dns "WLAN" 202.96.128.86
增加备用dns
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。