设置具体IP、DNS等信息

@echo off
set name="WLAN"
set ipaddress=192.168.36.107
set mask=255.255.255.0
set gateway=192.168.36.254
set dns=172.16.20.150

echo.
echo  本次网络设置如下:
echo  IP地址:%ipaddress%
echo  子网掩码:%mask%
echo  默认网关:%gateway%
echo  首选DNS:%dns%

netsh interface ip set address name=%name% source=static addr=%ipaddress% mask=%mask% gateway=%gateway% 1
netsh interface ip set dns name=%name% source=static addr=%dns% register=primary > nul
@pause

 

设置DHCP自动分配

@echo off
netsh interface ip set address name="WLAN" source=dhcp
netsh interface ip set dns name="WLAN" source=dhcp

 

参考链接:

https://blog.csdn.net/yyxaf/article/details/7289073

https://jingyan.baidu.com/article/ae97a646b7fcabbbfc461d4c.html

相关文章:

  • 2021-07-17
  • 2021-12-10
  • 2022-12-23
  • 2021-10-23
  • 2021-05-24
  • 2022-01-12
  • 2021-07-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-19
  • 2021-11-14
  • 2021-11-15
  • 2022-12-23
  • 2021-12-14
相关资源
相似解决方案