请教设置DNS
请假如何设置2个DNS??设置一个可以利用netsh命令,2个呢??
[ 本帖最后由 tzwwy 于 2008-5-9 12:27 编辑 ]
dim $strDNS
$strDNS="202.96.128.86"
$strDNS="202.96.128.143"
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$objItem.SetDNSServerSearchOrder($strDNS)
Next
EndIf
[ 本帖最后由 bing614 于 2008-5-8 17:47 编辑 ] 原帖由 bing614 于 2008-5-8 17:45 发表 http://www.autoitx.com/images/common/back.gif
dim $strDNS
$strDNS="202.96.128.86"
$strDNS="202.96.128.143"
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("Select * From Wi ...
测试没成功:face (36): 谢谢了!已解决,学习“IP地址随意换”的源代码!!! Runwait(@ComSpec & ' /c netsh -c interface ip set dns "本地连接" static 10.0.0.40 PRIMARY',"",@SW_HIDE)
Runwait(@ComSpec & ' /c netsh -c interface ip add dns "本地连接" 10.0.0.40 2',"",@SW_HIDE) 可以利用注册表进行操作!
页:
[1]