Notebook Win7 flagship system tips for setting IP addresses through batch processing

Source: Internet
Author: User

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).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.