Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the BAT execution script of automatically changing the native IP address with one click

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article is about how to implement a BAT execution script that automatically changes the native IP address with one click. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Please copy the following script, save it as .bat file, and modify the subnet mask, gateway, IP,DNS and other information into yours.

The following code has limitations: in fact, you can only set 192.168.1.* (2-254). If your ip is something else, you need to modify it and replace 192.168.1.1 with your gateway.

The code is as follows:

Cd\

Cls

@ echo off

Color a

: start

Set / p myip= "Please enter the IP assigned by the administrator:"

Cls

Echo, your IP address is% myip%

Pause

Color f

Cls

Echo is modifying your IP address, if there is a firewall pop-up, please set the permission to execute, please wait a moment.

Netsh interface ip set address name= "Local connection" source=static addr=%myip% mask=255.255.255.0

Cls

Echo is configuring your gateway, if there is a firewall pop-up, please set to allow execution, please wait a moment.

Netsh interface ip set address name= "Local connection" gateway=192.168.1.1 gwmetric=1

Cls

Echo is configuring your DNS. If there is a firewall pop-up, please set it to allow execution. Please wait a moment.

Netsh interface ip set dns name= "Local connection" source=static addr=192.168.1.1 register=PRIMARY

Cls

Echo is configuring your WINS. If there is a firewall pop-up, please set it to allow execution. Please wait a moment.

Netsh interface ip set wins name= "Local connection" source=static addr=none

Cls

Echo is updating your DNS, please wait a moment.

Ipconfig/flushdns

Thank you for reading! On "how to automatically change the local IP address of the BAT execution script" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report