网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 ip地址切换批处理脚本分享
内容
    这篇文章主要介绍了ip地址切换批处理脚本,改一下就可以就成ip地址切换器了,如果你有二个网络在使用一定会用的到,我在公司就是这么做的,需要的朋友可以参考下吧
    代码如下:
    @echo off
    rem # ----------------------------------
    rem # 接口 ip 配置
    rem # ----------------------------------
    echo =========ip 控制管理==========
    echo => d: 自动获取ip
    echo => h: 寝室 ip地址:66.168.1.8
    echo => r: 公司网络 ip地址:192.168.250.173
    echo 请输入对应的序号d,h,r,按回车键结束:
    set /p ch=
    if %ch%== echo you input null&goto :eof
    set case=d,h,t,w>nul
    echo %case%|findstr \<%ch%\>>nul&if errorlevel 1 goto :err
    goto %ch%
    goto err
    :h
    :: 寝室
    echo configure home ip address gateway,please wait 30 second ...
    @netsh int ip set address 本地连接 static 66.168.1.8 255.255.255.0 66.168.1.1 1 >nul
    @netsh int ip set dns 本地连接 static 66.168.1.1 primary >nul
    echo home ip configure is done
    goto :eof
    :r
    :: 公司网络
    echo configure transport ip address gateway,please wait 30 second ...
    @netsh int ip set address 本地连接 static 192.168.250.173 255.255.255.0 192.168.250.1 1 >nul
    echo transport ip configure is done
    goto :eof
    :d
    :dhcp 自动获取ip地址
    echo configure transport ip address gateway,please wait 30 second ...
    @netsh int ip set address 本地连接 dhcp >nul
    @netsh int ip set dns 本地连接 dhcp >nul
    :err
    :: error
    echo your input %ch% ,no this argument ! please input h or w! game over
    rem # 接口 ip 配置结束
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/6/11 3:12:25