1. Windows XP system Bat batch modifies IP address and DNS.
NEW: Text document, copy the following code to the text document, save as set IP Address.bat, double-click to run, you can!
@echo off
Echo **************************************************************************
echo * Modify IP address, DNS *
echo * Windows XP Copyright (C) 2013-02-05 *
Echo **************************************************************************
ECHO is modifying the IP address and DNS server address, please wait patiently ...
Echo is changing the native IP address ...
netsh interface ip set address "Local Area Connection" static 192.168.1.100255.255.255.0192.168.1.1 default
Echo is adding native preferred DNS servers ...
netsh interface ip set DNS "Local Area Connection" static 202.96.134.133
Echo is adding a native standby DNS server ...
netsh interface ip add DNS "Local Area Connection" 202.96.128.166
Echo Check the current native configuration ...
Ipconfig/all
Pause
2. Windows 7 System Bat batch modifies IP address and DNS.
NEW: Text document, copy the following code to the text document, save as set IP Address.bat, double-click to run, you can!
@echo off
Echo **************************************************************************
echo * Modify IP address, DNS *
echo * Windows 7 Copyright (C) 2013-02-05 *
Echo **************************************************************************
ECHO is modifying the IP address and DNS server address, please wait patiently ...
Echo is changing the native IP address ...
netsh interface ipv4 set address name= "Local Area Connection" Source=static addr=192.168.1.100 mask=255.255.255.0 gateway=192.168.1.1 Gwmetric=0 >nul
Echo is adding native preferred DNS servers ...
netsh interface ipv4 set DNS name= "Local Area Connection" Source=static addr=202.96.134.133 register=primary
Echo is adding an alternate DNS server ...
netsh interface ipv4 add DNS name= "Local Area Connection" addr=202.96.128.166
Echo Check the current native configuration ...
Ipconfig/all
Pause
IP Address parameter Description:
1.name: Network connection name, typically "local Area Connection". What name do you take for yourself?
2.source: The way to get IP. Dynamic fetch, then DHCP, or static if set manually.
3.ADDR: The IP address to set.
4.mask: Subnet mask.
5.gateway: Gateway address.
6.gwmetric: Gateway metric, can be set to integer value, or set to Auto: Auto.