Skip to content

Instantly share code, notes, and snippets.

@daicham
Created February 9, 2017 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save daicham/23544e4121b15e58992884c627e0413f to your computer and use it in GitHub Desktop.
Save daicham/23544e4121b15e58992884c627e0413f to your computer and use it in GitHub Desktop.
Set proxy config for Win
@echo off
set PROXY_SERVER="proxy.example.com:80"
set PROXY_OVERRIDE="172.30.*"
echo *** Set proxy config ***
echo PROXY_ENABLE
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /t REG_DWORD /d "1" /f
echo PROXY_SERVER: %PROXY_SERVER%
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyServer" /t REG_SZ /d %PROXY_SERVER% /f
echo PROXY_OVERRIDE: %PROXY_OVERRIDE%
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyOverride" /t REG_SZ /d %PROXY_OVERRIDE% /f
echo REMOVE AUTO_CONFIG_URL
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "AutoConfigURL" /f
echo *** Done ***
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment