Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement IP to dynamically switch bat scripts

Shulou Source: shulou.com Published: 2022-06-03 08:29:52 11月15日 Update

This article will explain in detail how to achieve IP dynamic switching bat script, the editor thinks it is very practical, so share it for you to do a reference, I hope you can get something after reading this article.

Create a new "IP switching script .bat" file, copy the following code into it, save it, and add the startup item, so that every time you choose your location when you boot, you can automatically switch IP ~

The code is very simple, if you want to add settings, I think you will understand it!

The code is as follows:

@ echo off color 0a title IP switching script-Create by Adobo@qq.com: start @ echo-- @ echo Please select your current location: @ echo 1. At home (enable DHCP) @ echo 2. Office (fixed IP) @ echo-- set / p sLocal= Please select: if% sLocal%==1 goto home if% sLocal%==2 goto office cls @ echo Please re-select goto start: home @ echo is setting wireless network connection to DHCP mode netsh interface ip set address wireless network connection dhcp goto end: office @ echo is setting wireless network connection as fixed IP:10.253.1.80 netsh interface ip set address wireless network connection static 10.253.1.80 255.255.252.0 10.253.0.1 1: end echo setting is complete Automatic exit on "how to achieve IP dynamic switching bat 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, please share it out for more people to see.

Tags: Switch select script wireless wireless network network code article dynamic location more being good practical content office file article time mode Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Shulou Information macOS Microsoft Huawei