BAT 设置WIFI代理"/>
BAT 设置WIFI代理
@echo off
echo waiting
timeout /t 5 > NUL
set "WIFI_PROXY_NAME=*******"
set NIC_num=0
REM 获取当前wifi名
for /f "tokens=1,2,3,* delims=: " %%i in ('netsh WLAN show interfaces') do (
if %%i==SSID (
set WIFI_name=%%j)
)
echo %WIFI_name%
REM 判断wifi是否需要代理
if %WIFI_name%==%WIFI_PROXY_NAME% (
goto setPROXY
) else (
goto cancelPROXY)
:setPROXY
echo **************************************************************************
echo * 设置代理 *
echo * Windows 10 Copyright (C) 2021-10-08 *
echo **************************************************************************
echo 开始设置proxy代理..........
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 "**.**.**.**:8080" /f
color 2
echo 已设置代理服务器上网
goto exist
:cancelPROXY
echo **************************************************************************
echo * 取消代理 *
echo * Windows 10 Copyright (C) 2021-10-08 *
echo **************************************************************************
echo 开始设置取消proxy代理..........
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
color 2
echo 已取消代理服务器上网
goto exist
:exist
更多推荐
BAT 设置WIFI代理
发布评论