經常在公司和家兩地用筆記本上網的人經常會遇到這樣的麻煩 公司和家裏用的不是一個IP 和DNS 每次手動更改都很麻煩
@echo off
title IP地址、網關、DNS自動設置程序
echo 正在更改IP 請稍後...
netsh interface ip set address 本地連接 static 192.168.3.152 255.255.255.0 192.168.3.1 default
echo 正在更改DNS
netsh int ip add dns name="本地連接" addr=202.98.0.68 index=1
netsh int ip add dns name="本地連接" addr=202.98.5.68 index=2
exit
更改IP 後面的default 必須加