@echo off netsh interface ip set address name="local" source=dhcp netsh interface ip set dns name="local" source=dhcp
@echo off netsh interface ip set address local static 192.168.0.84 255.255.255.0 192.168.0.254 netsh interface ip set dns local 192.168.0.254 netsh interface ip add dns local 202.106.196.115 index=2 netsh interface ip add dns local 202.106.0.20 index=3
注意:
"local" 為網卡名稱,可能是 "區域連線",請自行替換。set,後續用 add,請換成當地 DNS 伺服器。將腳本存為 .bat 檔,雙擊即可一鍵切換網路環境,告別手動設定煩惱。