1. 設置中輸入固定的IP和DNS,然后運行CMD命令輸入以下命令:netsh -c interface dump >c:\staticip.txt
2. 用同樣的方法將網卡TCP/IP屬性設置成在自動分配IP的網絡配置,執行以下命令:netsh -c interface dump >c:\autoip.txt
3.制作批處理文件staticip.bat內容為:netsh -f c:\staticip.txt
制作批處理文件autoip.bat內容為:netsh -f c:\autoip.txt