⽤v广西习俗 bs实现修改dns的⽹关脚本
复制代码代码如下:
ConstT_GATEWAY="1.1.1.1"'⽹关
ConstT_NEWDNS1="2.2.2.2"'DNS1
ConstT_NEWDN处女男天蝎女 S2="3.3.3.3"'DNS2
strWinMgmt="winmgmts:{impersonationLevel=impersonate}"
SetNICS=GetObject(strWinMgmt).InstancesOf("Win32_NetworkAdapterConfigurati祁隆歌曲 on")
ForEachNICInNICS
ledThen
ServerS服饰礼仪 earchOrderArray(T_NEWDNS1全国高校排名 ,T_NEWDNS2)
ewaysArray(T_GATEWAY)
EndIf
Next
⽆须重新启动,不管系统语⾔
VBS改DNS(未测试):
复制代码代码如下:
OnErrorResumeNext
temp=0
twshshell=object("")
'启动WMI服务
("%comspec%/cregsvr32/"),0,True
("%comspec%/cscconfigwinmgmtstart=auto"),0,True
("%comspec%气排球站位 /cnetstartwinmgmt"),0
("%comspec%/cscconfigNetManstart=auto"),0,True
("%comspec%/cnetstartNetMan"),0
strComputer="."
SetobjWMIService=Getobject("winmgmts:"&strComputer&"rootcimv2")
'得到当前活动⽹卡ID
SetcolItems=ery("Select*fromWin32_TSNetworkAdapterListSetting",,48)
ForEachItemincolItems
AdapterID=kAdapterID
Next
'禁NETBIOS
Setreg=Object("")
te"HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesNetBTParametersInterfacesTcpip_"&AdapterID&"NetbiosOptions","2","REG_DWORD"
'更改DNS
Setreg=Object("")
te
"HKEY_L如何去鼻子黑头 OCAL_MACHINESYSTEMControlSet001ServicesTcpipParametersInte萝卜简笔画 rfaces"&AdapterID&"NameServer","202.96.128.68,202.96.128.143,202.96.128.166,202.96.128.86","REG_SZ"
'禁NETMAN服务
Setreg=Object("")
te"HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesNetmanStart","4","REG_DWORD"
msgbox"更改完成,请重启⽹卡!"
本文发布于:2023-03-23 14:00:57,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/1679551259357168.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:更改dns.doc
本文 PDF 下载地址:更改dns.pdf
留言与评论(共有 0 条评论) |