Batch file set computer IP address

Source: Internet
Author: User
Tags get ip

Recently I have been carrying a notebook to work in the company, my headache is the day the company's network is to set up static IP, and the home network is automatically acquired. Oneself to the company opened a computer, every day the first thing is to re-enter the IP address and other information, it is very frustrating. I went to the Internet to check the batch processing set the IP address of the method, the following share to everyone. Preface

The static IP address is set primarily by the Netsh command, or automatically obtained. Netsh is a powerful network configuration command-line tool provided by the Windows system itself. set a static IP address

netsh interface ip set address name= "Local Area Connection" source= "static" Addr= "10.9.0.87" mask= "255.255.255.0" gateway= "10.9.0.254" gwmetric= "1"
netsh interface ip set DNS name= "Local Area Connection" Source=static addr= "8.8.8.8"

With the top two commands, you can set a static IP address, just change the corresponding information to your network information. set up auto Get IP

netsh interface ip set address "Local Area Connection" DHCP
netsh interface ip set DNS "Local Area Connection" DHCP

With the top two commands, you can set the IP address to get automatically.

In order to quickly change the IP address later, you can save the above two commands as a batch file with the suffix. bat, then double-click the batch file to quickly set the IP address. The following figure:

set static Ip.bat

set up auto get Ip.bat

Related Article

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.