Toggle the Bat Batch command for IP configuration

Source: Internet
Author: User
Tags goto
<span style= "FONT-SIZE:14PX;" ><span style= "FONT-SIZE:18PX;" ><strong><span style= "Font-family:simhei;" > Bat Processing command to switch IP configuration steps:</span></strong></span>
</span><pre name= "code" class= " Plain "><span style=" FONT-SIZE:18PX; > New txt text document,</span>
Copy the code below the split line,
Paste into txt document,
Modify the IP configuration below red according to your needs
Save and modify the file suffix to. bat
--------------------------------------Split Line---------------------------------------------------

@echo off
Color 1
Title Setting the Internet environment
echo★★★★ Please choose the Internet environment ★★★★
Echo company fixed mode ———— > Please press 1
echo Home Auto Mode ———— > Press 2

set/p n=

if/i "%n%" equ "1" goto guding
if/i "%n%" equ "2" goto Zidong

: guding

Echo you selected the company fixed IP mode

Echo is setting up, please later ...

netsh interface ipv4 set address name= "Local Area Connection" source=static
addr=10.10.90.6 mask=255.255.255.0 gateway=10.10.90.1 gwmetric=0 >nul

Echo is adding native primary DNS ...

netsh interface ipv4 set DNS name= "Local Area Connection" source=static
addr=202.101.172.47 register=primary

#echo Adding alternate DNS ...

#netsh interface IPv4 Add DNS name= "Local Area Connection"
addr=202.102.199.68

Goto END

: Zidong
echo You have selected home Auto capture mode
Echo is setting up, please later ...
echo automatically gets the IP address ....

@echo off

netsh interface ip set address name = "Local Area Connection" Source = DHCP

echo Auto Get DNS server ....

netsh interface ip set dns name = "Local Area Connection" Source = DHCP

Goto END

: End

Color 2

echo☆☆☆☆☆☆☆☆ the current IP configuration for this machine is as follows ☆☆☆☆☆☆☆☆☆☆☆☆

Ipconfig

echo☆☆☆☆☆☆☆☆ Setup Success! Thanks for using ☆☆☆☆☆☆☆☆☆☆☆☆

Pause

--------------------------------------------Split Line------------------------------------------------------------





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.