代理清理2.0:清理代理后自动关闭代理程序

@echo off
title 自动清除IE代理并关闭代理软件

:: ProxyEnable用来表示是否使用代理,用0,1表示,类型为REG_DWORD 
:: ProxyServer用来表示代理服务器 ip:port,如 "localhost:8080",类型为REG_SZ 
:: ProxyOverride表示跳过代理的配置,比如跳过本地代理,该值为"<local>" 
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 0 /f
 
echo 检测代理服务器设置是否清除成功
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable

echo 刷新网络设置
ipconfig /flushdns

echo 准备关闭代理程序...
taskkill /f /im "ShadowsocksR.exe"
taskkill /f /im "v2rayN.exe"

echo 代理服务器设置已经清空

:: 代理服务器设置已经清空,2秒后程序自动关闭,按下CTRL+C来跳过
TIMEOUT /T 2 /NOBREAK
echo over