modifying IP addresses and DNS configuration using batch processing

Source: Internet
Author: User
Tags get ip modify

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.

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.