写在前边
作⽤
通过BAT脚本对WIN代理服务进⾏开关,以达到访问外⽹的功能;
参考
主要参考(⼏乎全抄):
将要参考:
代理服务器设置
我是使⽤⼿机的V*2*R*A*Y懂的就懂,在它的“设置”中勾选“允许来⾃局域⽹的连接”,其中HTTP默认代理端⼝即为10809,然后在WIFI中能看到⾃⼰的IP地址,即为图中设置;两台机器在同⼀个局域⽹中,WIN机器即可通过⼿机代理访问外⽹;
代码如下
@echo off
echo===========================================
echo请选择要进⾏的操作,然后按回车
echo===========================================
echo.
echo S.修改ip为内⽹ip,并设置代理
echo.
echo R.恢复ip为动态ip,并关闭代理
echo.
echo Q.退出
echo.
陈僖仪车祸原因echo.
echo.
:loop_start
赖小民情人有哪个明星set /p choice=请选择:
IF NOT "%choice%"=="" SET choice=%choice:~0,1%
if /i "%choice%"=="S" goto set_start
if /i "%choice%"=="S" goto set_start
明星和他们的孩子if /i "%choice%"=="R" goto reset_start
if /i "%choice%"=="Q" goto closee
echo选择⽆效,请重新输⼊
echo.
goto loop_start
::====================================================================================
:set_start
青春励志电影排行榜echo设置IP地址....
netsh interface ip set addr "以太⽹" static 192.168.20.107 255.255.255.0 192.168.20.1 1
echo设置DNS地址....
netsh interface ip set dns "以太⽹" static 114.114.114.114 primary validate=no
echo *****设置成功!您的IP已修改为内⽹ip
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 "192.168.60.123:10809" /f
reg add"HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "localhost;127.*;10.*;172.16.*;172.17.*;172.1 8.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*;192.168.*;<local>" /f
rem “对于本地地址不使⽤代理服务器”这个勾,不会勾选上
::reg add"HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "11.*;68.*;10.*;" /f
rem “对于本地地址不使⽤代理服务器”这个勾,会勾选上
::reg add"HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "11.*;68.*;10.*;<local>" /f
echo.
echo *****设置成功!代理服务器设置完毕
echo.
goto endd
::====================================================================================
:reset_start
总裁 ceo 董事长
echo恢复IP地址....
netsh interface ip set addr "以太⽹" dhcp
echo恢复DNS地址....
netsh interface IP set dns "以太⽹" dhcp
echo *****设置成功!您的IP已恢复为动态ip
echo.
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
reg add"HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "" /f
echo.
echo *****设置成功!代理服务器设置已经清空
echo.
goto endd
::====================================================================================
:endd
pause
:closee
发布评论