Set the IP address for Batch Processing-imsoft. cnblogs

Source: Internet
Author: User
I don't know if my friends have such experiences when setting IP addresses for batch processing. When I bring this book to the Internet, the Unit needs to configure a fixed IP address, and the home automatically obtains the IP address, so we need to set this IP address every day. Is there a simple and convenient way? In fact, we can do a batch processing, each time you need to set an IP address, you just need to run the batch processing.

1. Set IP address batch processing and save the following code as a. BAT file in notepad, for example, static. bat. Double-click it to run it.

@ Echo off

Echo tool for modifying local IP addresses

ECHO is setting your IP address as a static address. Please wait ......

Netsh interface IP Set address name = "Local Connection" Source = static ADDR = 192.168.1.102 mask = 255.255.255.0

Netsh interface IP Set address name = "Local Connection" Source = static gateway = 192.168.1.1 gwmetric = 0

Netsh interface IP Set DNS name = "Local Connection" Source = static ADDR = 41.211.224.7 register = primary

Netsh interface IP add DNS name = "Local Connection" ADDR = 41.211.224.3

Netsh interface IP Set wins name = "Local Connection" Source = static ADDR = none

The parameters in the above Code are described as follows. You can modify them based on your actual situation:

ADDR = 192.168.1.102 -- IP Address

Mask = 255.255.255.0 -- Subnet Mask

Gateway = 192.168.1.1 -- Gateway

ADDR = 41.211.224.7 -- preferred DNS

ADDR = 41.211.224.3 -- backup DNS (if no backup DNS exists, delete the entire line of code)

2. Set to automatically obtain the IP address. Save the following code in Notepad as A. BAT file, such as DHCP. bat. Double-click it to run it.

@ Echo off

Echo tool for modifying local IP addresses

ECHO is setting to automatically obtain the IP address. Please wait ......

Netsh interface IP Set address name = "Local Connection" Source = DHCP

Netsh interface IP Set DNS name = "Local Connection" Source = DHCP

Note: The "Local Link" in the above Code is the default name of the network link system in your computer. If you have installed Multiple NICs or renamed the local link, change the Local Link name in the code to your current name.

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.