批处理程序

本文介绍了一个用于在不同网络环境下快速切换IP配置的批处理脚本。通过简单的菜单选择,用户可以快速地将电脑的网络配置更改为电大IP、校园网IP或寝室IP,适用于需要频繁更改网络设置的场景。

这是我在【学校、寝室、的几个ip不行手动改,就用一个批处理程序运行来操作,很方便


@echo off

echo 请选择使用IP:
echo 1、电大IP
echo 2、校园网IP
echo 3、寝室
set /p num=请输入你的选择:
if %num% ==1 goto one
if %num% ==2 goto two
if %num% ==3 goto three
:one
netsh int ip set address "本地连接" static 192.168.4.123 255.255.255.0 192.168.4.1 1
netsh int ip set dns "本地连接" static 202.102.224.68 primary
netsh interface ip add dns "本地连接" 8.8.8.8 index=2 
echo IP设置完成 &pause >nul
pause
:two
netsh int ip set address "本地连接" static 172.18.25.234 255.255.0.0 172.18.0.1 1
netsh int ip set dns "本地连接" static 202.196.96.131 primary
netsh interface ip add dns "本地连接" 8.8.8.8 index=2 
echo IP设置完成 &pause >nul
:three
netsh int ip set address "本地连接" static 192.168.18.102 255.255.255.0 192.168.18.254 1
netsh int ip set dns "本地连接" static 202.196.96.131 primary
netsh interface ip add dns "本地连接" 8.8.8.8 index=3 
echo IP设置完成 &pause >nul
pause




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值