• 命令行设置IE代理


    IE代理可以在注册表中设置,所以用DOS修改注册表,可以达到目的.
    方法一:
    注册表文件:
    REGEDIT4
    [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settings]
    "ProxyEnable"=dword:00000001
    "ProxyServer"="192.168.0.1:8088"
    "ProxyOverride"="192.168.*"
    保存为reg文件,如proxy.reg,然后在DOS中,导入注册表:
    regedit /s proxy.reg

    方法二:

    使用bat脚本处理

    @echo off
    echo 【修改IE】
    
    rem “是否启用本地IE代理设置,值为1表示启用,勾选“为LAN使用代理服务器”前面的勾,值为0表示禁用,则不会勾选上
    reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
    
    rem “设置代理服务器地址和端口号
    reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings" /v ProxyServer /d "12.123.12.12:8080" /f
    
    rem “对于本地地址不使用代理服务器”这个勾,不会勾选上
    reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings" /v ProxyOverride /t REG_SZ /d "11.*;68.*;10.*;" /f
    
    rem “对于本地地址不使用代理服务器”这个勾,会勾选上
    ::reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings" /v ProxyOverride /t REG_SZ /d "11.*;68.*;10.*;<local>" /f

    其中最下面的两行已经做了说明,我就不解释了。如下图

    参考:
    http://zhidao.baidu.com/question/42517242.html
    http://zhidao.baidu.com/question/349423330.html

    =================================================================================

    根据上面的知识,我写了个启用或禁用IE代理的脚步,方便在家里和公司的环境进行切换,代码如下

    @echo off
    echo 【修改IE代理设置】
    set /p var=是否启用IE代理设置[Y/N]:
    if /i %var%==Y (goto ProxyEnable) else (goto ProxyDisable)
    
    :ProxyEnable
    reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
    echo 你已启用IE代理
    goto end
    
    :ProxyDisable
    reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
    echo 你已禁用IE代理
    goto end
    
    :end
    Pause
  • 相关阅读:
    利用同步网盘搭建个人或团队SVN服务器
    Entity FrameWork Code First 之 MVC4 数据库初始化策略用法
    Entity FrameWork Code First 迁移命令详解
    Bootstrap Paginator分页插件+ajax
    Bootstrap的js分页插件属性介绍
    AtomicBoolean介绍与使用
    java线程:Atomic(原子)
    Java里的CompareAndSet(CAS)
    ThreadLocal详解
    CalendarUtil 日期操作工具类
  • 原文地址:https://www.cnblogs.com/mq0036/p/4817430.html
Copyright © 2020-2023  润新知