批處理解決換ip問題

2021-09-29 06:45:44 字數 544 閱讀 5247

netsh inte***ce ip set address "網絡卡名字" static ip位址 子網掩碼 預設閘道器

netsh inte***ce ip set dns "網絡卡名字" source=static addr=預設dns

netsh inte***ce ip add dns "網絡卡名字" addr= 備用dns

例如:netsh inte***ce ip set address "乙太網" static 10.18.110.136 255.255.255.0 10.18.110.254

netsh inte***ce ip set dns "乙太網" source=static addr=10.19.240.240

netsh inte***ce ip add dns "乙太網" addr= 10.19.240.241

自動獲取ip位址和dns位址

netsh inte***ce ip set address "乙太網" source=dhcp

netsh inte***ce ip set dns "乙太網" source=dhcp

批處理解決環境變數的問題

前一段時間我一直為如果在新增環境變數而苦惱。因為不想每次都是通過 我的電腦 屬性 來增加 環境變數 因為不是每個人都懂怎麼做,尤其對於一些對計算機不是很懂的人。起先我想到的是用登錄檔來實現。先將增加環境變數的地方匯出來,然後通過命令c windows regedit s environment.re...

批處理修改IP

上次乙個要我做的乙個ip轉換的批處理,貼出來給大家使用.可以在2個ip之前相互轉換,不必再去修改本地連線了,你要做的只是輸入1或者2。請按自己的須求做相應的修改,原始碼如下 echo off title ip轉換工具 powered by px mode con cols 40 lines 10 c...

批處理改IP

最近經常切換網路,又要改動態ip 一會又要改回靜態ip,挺麻煩的。下面的內容是改為動態獲取ip 另存為autoip.bat雙擊就可以了 echo off rem eth eth為網絡卡名稱,可在網路連線中查詢,如 本地鏈結 set eth 本地連線 echo 正在修改ip為自動獲取,請稍候 cmd ...