Const T_GATEWAY = "1.1.1.1" '网关 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