批处理程序

来源:互联网 发布:java视频教学网站 编辑:程序博客网 时间:2024/06/07 13:13

这是我在【学校、寝室、的几个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




原创粉丝点击