Const STR_GATEWAY = "192.168.0.1" Const STR_NEWDNS1 = "61.147.37.1" Const STR_NEWDNS2 = "202.102.10.141" 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) objNIC.SetGateways Array(STR_GATEWAY) End If
Const STR_NEWDNS1 = "61.144.56.100" Const STR_NEWDNS2 = "202.96.128.68" 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
echo off regedit /s \\server\xx\xx.reg cls
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces\{B130BF2A-0BD5-4B4D-B3A9-55A94FC46694}] "UseZeroBroadcast"=dword:00000000 "EnableDeadGWDetect"=dword:00000001 "EnableDHCP"=dword:00000000 "IPAddress"=hex(7):31,00,39,00,32,00,2e,00,31,00,36,00,38,00,2e,00,32,00,2e,00, 32,00,30,00,31,00,00,00,00,00 "SubnetMask"=hex(7):32,00,35,00,35,00,2e,00,32,00,35,00,35,00,2e,00,32,00,35, 00,35,00,2e,00,30,00,00,00,00,00 "DefaultGateway"=hex(7):31,00,39,00,32,00,2e,00,31,00,36,00,38,00,2e,00,32,00, 2e,00,32,00,35,00,34,00,00,00,00,00 "DefaultGatewayMetric"=hex(7):31,00,00,00,00,00 "NameServer"="202.96.128.166,61.144.56.100" "Domain"="" "DisableDynamicUpdate"=dword:00000000 "EnableAdapterDomainNameRegistration"=dword:00000000 "InterfaceMetric"=dword:00000001 "TCPAllowedPorts"=hex(7):30,00,00,00,00,00 "UDPAllowedPorts"=hex(7):30,00,00,00,00,00 "RawIPAllowedProtocols"=hex(7):30,00,00,00,00,00 "NTEContextList"=hex(7):30,00,78,00,30,00,30,00,30,00,30,00,30,00,30,00,30,00, 32,00,00,00,00,00 "DhcpClassIdBin"=hex: "DhcpServer"="255.255.255.255" "Lease"=dword:00000e10 "LeaseObtainedTime"=dword:45090a44 "T1"=dword:4509114c "T2"=dword:45091692 "LeaseTerminatesTime"=dword:45091854 "IPAutoconfigurationAddress"="0.0.0.0" "IPAutoconfigurationMask"="255.255.0.0" "IPAutoconfigurationSeed"=dword:92437cc6 "AddressType"=dword:00000000 |