Windows set proxy script

Date: 2021-02-18
:: local vars
set proxy_base=my.proxy.com:9000
set proxy=http://%proxy_base%
set noproxy=127.0.0.1,::1,localhost,.lan,.local
:: set machine environment variable
setx HTTP_PROXY %proxy% /m
setx HTTPS_PROXY %proxy% /m
setx NO_PROXY %noproxy% /m

netsh winhttp set proxy %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 /t REG_SZ /d %proxy_base% /f

pause
46490cookie-checkWindows set proxy script