以下内容为网络搜集,以备参考。
echo 正在清空代理服务器设置……
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /f
rem reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d 0 /f
echo 代理服务器设置已经清空……
echo 正在设置代理服务器……
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "10.22.96.29:8080" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "" /f
echo 正在设置DNS……
netsh interface ip set dns 本地连接 static 202.106.196.115 primary
netsh interface ip add dns 本地连接 202.106.46.151 index=2
netsh interface ip add dns 本地连接 202.106.0.20 index=3
echo 正在设置网关……
netsh interface ip set address name="本地连接" gateway=10.88.55.126 gwmetric=auto
echo 正在设置WINS……
netsh interface ip set wins 本地连接 static 10.88.55.121
echo 正在刷新设置……
ipconfig /flushdns
echo 显示新的设置:
ipconfig /all
echo 设置完毕,按任意键退出!
pause
保存为.bat文件即可。
也可以先将bat文件转换成exe文件,然后在通过如下操作将设置代理小功能放到ie工具栏中:
然后单击“开始→运行”命令,并在其对话框中输入“gpedit.msc”命令,打开“组策略编辑器”。在左侧窗口中依次展开“用户配置 →Windows 设置→Internet Explorer维护→浏览器用户界面”分支,接着在右侧窗口中双击“浏览器工具栏自定义”,并在弹出的窗口中单击“添加”按钮进入“浏览器工具栏按钮信 息”对话框,在“工具栏标题(必需)”处输入按钮在IE工具栏上显示的文字,在“工具栏操作(必需)”处点击“浏览”按钮找到记事本程序所在的路径(如 C:\Windows\Notepad.exe),在“工具栏颜色图标(必需)”和“工具栏灰度图标(必需)”处分别输入按钮在IE工具栏上显示的颜色图 标和灰度图标文件的完整路径,这两个图标可以相同。最后把“默认情况下,该按钮应显示在工具栏上”复选框选上即可。
##################################################################################
//网上找的,没用过,只当学习 @echo off :bensla~ :adsl :noproxy :szunet :proxy :internet :localproxy :szuproxy :exit |
##################################################################################
批处理自动设置ie代理IP
@echo off
setlocal enabledelayedexpansion
::3c标 01计数器 03(01)是(否)启用代理 FF行偏移量&h10(ip+prot字符串长度,变量cs)
set "head=3C0000000100000003000000FF000000"
set "regp="HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections""
set ip=1.1.1.1:80
::上边设置代理IP与端口
set name=宽带连接
::上边设置宽带连接名称
call :binary 0
reg add %regp% /v %name% /t REG_BINARY /d %head%%hex% /f
pause
goto :eof
:binary
set var=!ip:~%cs%,1!||set hex=%hex:.=2E%&& set hex=!hex::=3A!&&goto :eof
if %var%. GEQ 0 set /a var+=30
set hex=%hex%%var%
set /a cs+=1
call :binary %cs%
goto :eof
##################################################################################
@rem 运行此批处理*****【如果添加了代理就删除,反之没有代理就添加代理】*****
@echo off
title 添加/删除IE代理 &&MODE con COLS=30 LINES=3 &color 2e
setlocal ENABLEDELAYEDEXPANSION
@set uu=“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings“
@for /f “skip=3 tokens=3“ %%i in (‘reg query %uu% /v ProxyEnable‘) do (if “%%i“==“0x0“ (goto sset) else (goto ddel))
:sset
setlocal ENABLEDELAYEDEXPANSION
set uu=“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings“
reg add %uu% /v ProxyServer /t REG_SZ /d “192.168.1.4:8090“ /f >nul
reg add %uu% /v ProxyOverride /t REG_SZ /d “<local>“ /f >nul
reg add %uu% /v ProxyEnable /t REG_DWORD /d “1“ /f >nul
echo.&echo 添加了代理 &ping -n 2 127.1 >nul &&goto :eof
:ddel
setlocal ENABLEDELAYEDEXPANSION
set uu=“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings“
reg delete %uu% /v ProxyServer /f >nul
reg delete %uu% /v ProxyOverride /f >nul
reg add %uu% /v ProxyEnable /t REG_DWORD /d “0“ /f >nul
echo.&echo 删除了代理 &ping -n 2 127.1 >nul &&goto :eof