netsh.exe 是 Windows 內建強大的網路設定命令列工具,支援顯示/修改 TCP/IP 設定、切換多組網路環境、設定 DHCP/靜態 IP、WINS、DNS 等,筆電使用者必學。
| 功能 | 指令範例 |
|---|---|
| 顯示目前 TCP/IP 設定 | netsh interface ip show config |
| 設定靜態 IP(本地連線) | netsh interface ip set address name="區域連線" static 192.168.0.100 255.255.255.0 192.168.0.1 1 |
| 設定 DHCP 自動取得 IP | netsh interface ip set address "區域連線" dhcp |
| 匯出目前網路設定為檔案 | netsh -c interface dump > c:\location1.txt |
| 匯入網路設定檔 | netsh -f c:\location1.txt |
| 設定靜態 WINS | netsh interface ip set wins "區域連線" static 192.168.0.200 |
| 設定 DNS 為 DHCP 自動取得 | netsh interface ip set dns "區域連線" dhcp |
location1.txt。location2.txt。netsh -f locationX.txt 即可一鍵套用。指令中「區域連線」需依實際網路連線名稱調整(可在「網路連線」查看)。所有指令建議在管理員權限的命令提示字元執行。