@rem echo OFF rem This file runs in Command Mode. Use at your own risk. rem The name in the inverted commas must match your connection name set lan_name="Wireless Network Connection" rem define the first part of the network addresses here rem first set the subnet address for the ip address and default gateway set ipsubnet=192.168.1 rem next set the subnet address for the DNS servers set dnssubnet=194.44.65 rem Set each of IP address, Subnet mask and Default gateway set lan_ip=%ipsubnet%.150 set sub_net_mask=255.255.255.0 set gateway_addr=%ipsubnet%.254 rem Set both the DNS values set pri_dns_addr=%dnssubnet%.69 set sec_dns_addr=%dnssubnet%.68 rem set the ip address @netsh interface ip set address name=%lan_name% source=static addr=%lan_ip% mask=%sub_net_mask% gateway=%gateway_addr% gwmetric=1 rem set the preferred DNS @netsh interface ip set dns name=%lan_name% source=static addr=%pri_dns_addr% primary rem add the alternative DNS @netsh interface ip add dns name=%lan_name% addr=%sec_dns_addr% index=2