因公司网络分内外网,换掉网线后需要重新设置网络地址,设置起来很麻烦,从网络找到的批处理。记录下这种简单的方式。
拷贝放到txt文件,改后缀为bat,即可。
// 设置为手动设置网络地址
@echo.
@echo -------------------------------------------
@echo.
@echo 更改“本地链接”IP地址
@echo IP:172.16.79.34
@echo 子网掩码:255.255.248.0
@echo 网关:172.16.72.254
@echo DNS:172.16.0.65
@echo.
@echo -------------------------------------------
@echo.
@echo.
@echo Powered By cjq
@echo.
@echo off
netsh interface ip set address name="本地连接" source=static addr=172.16.73.89 mask=255.255.248.0 gateway=172.16.72.254 gwmetric=0
netsh interface ip set dns name="本地连接" source=static addr=172.16.0.65
// 设置为自动获取网络地址
@echo.
@echo -------------------------------------------
@echo.
@echo 更改“本地链接”IP地址
@echo IP:DHCP
@echo DNS:DHCP
@echo.
@echo -------------------------------------------
@echo.
@echo.
@echo Powered By cjq
@echo off
netsh interface ip set address name="本地连接" source=dhcp
netsh interface ip set dns name="本地连接" source=dhcp