type 網路配置.bat echo #設靜態IP netsh interface ip set address name="無線網路連接" source=static addr=192.168.1.20 mask=255.255.255.0 echo #設默認網關 netsh interface ip set address name="無線網路連接" gateway=192.168.1.1 gwmetric=0 echo #設首選dns netsh interface ip set dns name="無線網路連接" source=static addr=192.168.1.1 register=PRIMARY echo #設備用dns netsh interface ip add dns name="無線網路連接" addr=211.90.88.129 index=2 netsh interface ip set wins name="無線網路連接" source=static addr=none echo # echo #顯示「無線網路連接」配置結果 netsh interface ip show config 無線網路連接 echo # echo # "本地連接" 的介面 IP 配置 echo #設自動獲取ip netsh interface ip set address name="本地連接" source=dhcp echo #設自動獲取dns netsh interface ip set dns name="本地連接" source=dhcp register=PRIMARY echo netsh interface ip set wins name="本地連接" source=dhcp
echo #顯示「本地連接」配置結果 netsh interface ip show config 本地連接 echo # 介面 IP 配置結束