主頁(yè) > 知識(shí)庫(kù) > 用vbs實(shí)現(xiàn)修改dns的網(wǎng)關(guān)腳本

用vbs實(shí)現(xiàn)修改dns的網(wǎng)關(guān)腳本

熱門(mén)標(biāo)簽:天津智能外呼系統(tǒng)排名 外呼系統(tǒng)群 企業(yè)400電話辦理價(jià)錢(qián)低 外呼系統(tǒng)說(shuō)話聲音小怎么辦 墨西哥地圖標(biāo)注app 上海辦理400電話選號(hào) 智云億呼電話機(jī)器人 機(jī)器人打電銷適用于美業(yè)嗎 龍巖400電話申請(qǐng)
復(fù)制代碼 代碼如下:

Const T_GATEWAY = "1.1.1.1" '網(wǎng)關(guān)
Const T_NEWDNS1 = "2.2.2.2" 'DNS1
Const T_NEWDNS2 = "3.3.3.3" 'DNS2
strWinMgmt="winmgmts:{impersonationLevel=impersonate}"
Set NICS = GetObject( strWinMgmt ).InstancesOf("Win32_NetworkAdapterConfiguration")
For Each NIC In NICS
If NIC.IPEnabled Then
NIC.SetDNSServerSearchOrder Array(T_NEWDNS1,T_NEWDNS2)
NIC.SetGateways Array(T_GATEWAY)
End If
Next
 

無(wú)須重新啟動(dòng),不管系統(tǒng)語(yǔ)言

VBS改DNS(未測(cè)試):

復(fù)制代碼 代碼如下:

On Error Resume Next
temp=0
set wshshell=wscript.createobject("wscript.shell")
'啟動(dòng)WMI服務(wù)
wshshell.run ("%comspec% /c regsvr32 /s scrrun.dll"),0,True
wshshell.run ("%comspec% /c sc config winmgmt start= auto"),0,True
wshshell.run ("%comspec% /c net start winmgmt"),0
wshshell.run ("%comspec% /c sc config NetMan start= auto"),0,True
wshshell.run ("%comspec% /c net start NetMan"),0

strComputer = "."
Set objWMIService = Getobject("winmgmts:\" strComputer "\root\cimv2")

'得到當(dāng)前活動(dòng)網(wǎng)卡ID
Set colItems = objWMIService.ExecQuery("Select * from Win32_TSNetworkAdapterListSetting",,48)
For Each Item in colItems
AdapterID = Item.NetworkAdapterID
Next

'禁NETBIOS
Set reg = WScript.CreateObject("WScript.Shell")
reg.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces\Tcpip_"AdapterID"\NetbiosOptions","2","REG_DWORD"

'更改DNS
Set reg = WScript.CreateObject("WScript.Shell")
reg.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces"AdapterID"\NameServer","202.96.128.68,202.96.128.143,202.96.128.166,202.96.128.86","REG_SZ"

'禁NETMAN服務(wù)
Set reg = WScript.CreateObject("WScript.Shell")
reg.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Netman\Start","4","REG_DWORD"

msgbox "更改完成,請(qǐng)重啟網(wǎng)卡!"

標(biāo)簽:青島 阜新 承德 鄂爾多斯 黃山 錫林郭勒盟 齊齊哈爾 麗水

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《用vbs實(shí)現(xiàn)修改dns的網(wǎng)關(guān)腳本》,本文關(guān)鍵詞  用,vbs,實(shí)現(xiàn),修改,dns,的,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《用vbs實(shí)現(xiàn)修改dns的網(wǎng)關(guān)腳本》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于用vbs實(shí)現(xiàn)修改dns的網(wǎng)關(guān)腳本的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章