1, first right mouse click win7 System desktop Space Select first create a new text file, and then modify its suffix named ". cmd" or ". bat";
2, then the following code copy sticky paste in, and then save and close the file;
The IP address code is automatically obtained as follows:
@echo off
echo----A batch file of automatic Access IP addresses from Garfieldjiang columns---
echo-----Http://hi.csdn.net/jiangzhanchang------------------
Echo--------------------------------------------------------
Echo is setting up an automatic IP address, please wait ...
netsh interface ipv4 set address name= "Local Area Connection" Source=dhcp
: The above code set IP address automatic acquisition
netsh interface ipv4 set DNS name= "Local Area Connection" Source=dhcp
: The above code sets the DNS automatic acquisition
: "Local Area Connection" in the preceding lines of code can be modified as needed, such as "Wireless network Connection"
If%errorlevel%==0 (netsh interface ipv4 show ip) Else (echo---------------------error!-----------------&echo error code:% Errorlevel%&echo Right-click to select "Run with admin" &echo---------------------------------------------------)
Pause
Manually set the IP address code as follows:
@echo off
echo----A batch file of automatic Access IP addresses from Garfieldjiang columns---
echo-----Http://hi.csdn.net/jiangzhanchang------------------
Echo--------------------------------------------------------
ECHO is setting the IP address manually, please wait ...
netsh interface ipv4 set address "Local Area Connection" Static 192.168.0.100 255.255.255.0 192.168.0.1
: The above line address is: IP address, subnet mask, default gateway
netsh interface ipv4 set dnsservers "Local Area Connection" static 192.168.0.1 Primary
: Set the primary DNS server address on the line above
netsh interface ipv4 set dnsservers "local connection" static 192.168.0.1
: Set secondary DNS server address on line above
: "Local Area Connection" in the preceding lines of code can be modified as needed, such as "Wireless network Connection"
If%errorlevel%==0 (netsh interface ipv4 show ip) Else (echo---------------------error!-----------------&echo error code:% Errorlevel%&echo Right-click to select "Run with admin" &echo---------------------------------------------------)
Pause
3, after the save close, then right click on the file, select "Open" Can (Windows7 need to choose to use the administrator to run).