自动更改DNS的VBS脚本2007年01月27日 星期六 下午 02:06
Const STR_NEWDNS1 = "202.103.225.68"
Const STR_NEWDNS2 = "202.103.229.40"
Set fs=CreateObject("Scripting.FileSystemObject")
strWinMgmt="winmgmts:{impersonationLevel=impersonate}"
Set objNICs = GetObject( strWinMgmt ).InstancesOf("Win32_NetworkAdapterConfiguration")
For Each objNIC In objNICs
If objNIC.IPEnabled Then
objNIC.SetDNSServerSearchOrder Array(STR_NEWDNS1,STR_NEWDNS2)
End If
next