@echo off rem eth //eth 為網(wǎng)卡名稱,可在網(wǎng)絡連接中查詢,如”本地鏈接” set eth=”無線網(wǎng)絡連接” rem ip //ip 為你想更改的IP set ip=192.168.1.8 rem gw //gw 為網(wǎng)關地址 set gw=192.168.1.1 rem netmasks //netmasks 為子網(wǎng)掩碼 set netmasks=255.255.255.0 echo 正在將本機IP更改到: %ip% rem if %gw%==none netsh interface ip set address %eth% static %ip% %netmasks% %gw% > nul if not %gw%==none netsh interface ip set address %eth% static %ip% %netmasks% %gw% 1 > nul echo……………………. echo 檢查當前本機IP: ipconfig echo……………………. echo 成功將本機IP更改為%ip%! pause close