cmd/bat关闭或开启局域网代理
功能
简单的判断局域网代理是否开启, 关闭则开启, 开启则关闭.
@echo off
Setlocal enabledelayedexpansion
for /f "skip=2 delims=: tokens=1,*" %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable"') do (set str=%%i)
set a=%str:~-3%
echo %a%
if "%a%"=="0x0" (reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f) else if "%a%"=="0x1" (reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f)
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable
taskkill /f /im explorer.exe
start explorer.exe