1. 程式人生 > >用bat批處理自動修改本機IP地址

用bat批處理自動修改本機IP地址

@ECHO OFF @ECHO ----------  設定本機IP地址  ---------- if {%1}=={} netsh interface IP set address "本地連線" static 192.168.1.88 255.255.252.0 >nul if NOT {%1}=={} netsh interface IP set address "本地連線" static %1 255.255.252.0 >nul netsh interface IP set address "本地連線" static gateway=192.168.1.1 gwmetric=1 >nul @ECHO. @ECHO 設定成功! netsh interface IP set dns "本地連線" static 202.96.128.86 >nul netsh interface ip add dns "本地連線" 202.96.128.166 index=2 >nul

設定完成後系統變成這樣:

可根據需要修改