Windows bat 设置代理

转自tt-0411

@echo off
cls
color 0A
Echo The program is running...
Echo Setting the ip and dns...
netsh interface ip set address name="Local Connection" source=dhcp
netsh interface ip delete dns "Local Connection" all
ipconfig /flushdns
ipconfig /all
Echo Done.
Echo Setting the proxy
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings" /v ProxyServer /d "proxy:80" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings" /v ProxyOverride /t REG_SZ /d "" /f
ipconfig /flushdns
Echo Done. 
Echo Press any key to leave...
Pause

这段代码第一部分设置ip地址为自动获取,然后设置代理服务器为“porxy:80”;

原文地址:https://www.cnblogs.com/Clearner/p/4440873.html