Skip to content

Instantly share code, notes, and snippets.

@ichimarusakura
Forked from HamGuy/changeIP.bat
Created June 30, 2017 01:45
Show Gist options
  • Select an option

  • Save ichimarusakura/883c55df10c9ecdffd2fe77a1816b167 to your computer and use it in GitHub Desktop.

Select an option

Save ichimarusakura/883c55df10c9ecdffd2fe77a1816b167 to your computer and use it in GitHub Desktop.
批处理脚本-快速改变 IP 地址
@echo off
echo **************************************************************************
echo * 修改IP地址、DNS *
echo * *
echo **************************************************************************
echo 正在修改IP地址和DNS服务器地址,请耐心等待…………
echo 正在更改本机IP地址...
netsh interface ipv4 set address name="本地连接" source=static addr=192.168.1.100 mask=255.255.255.0 gateway=192.168.1.1 gwmetric=0 >nul
echo 正在添加本机首选DNS服务器...
netsh interface ipv4 set dns name="本地连接" source=static addr=202.96.134.133 register=PRIMARY
echo 正在添加备用DNS服务器...
netsh interface ipv4 add dns name="本地连接" addr=202.96.128.166
echo 检查当前本机配置...
ipconfig /all
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment