Skip to content

Commit 722bb3b

Browse files
committed
New: Add ProxySwtich
1 parent ab6e53f commit 722bb3b

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

SwitchProxy.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
for /f "tokens=1,2,* " %%i in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable ^| find /i "ProxyEnable"') do (set /A ProxyEnableValue=%%k)
3+
4+
if %ProxyEnableValue% equ 0 (
5+
echo 系统代理目前处于关闭状态,正在开启代理,请稍候...
6+
echo=
7+
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f >nul 2>nul
8+
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "127.0.0.1:7890" /f >nul 2>nul
9+
echo 系统代理已开启
10+
) else if %ProxyEnableValue% equ 1 (
11+
echo 系统代理目前处于开启状态,正在关闭代理,请稍候...
12+
echo=
13+
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f >nul 2>nul
14+
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /f >nul 2>nul
15+
echo 系统代理已关闭
16+
)
17+
timeout /nobreak /t 2

clash.exe

15 KB
Binary file not shown.

0 commit comments

Comments
 (0)