开启代理:
@echo off 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 /d "proxy3.bj.petrochina:8080" /f reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "*.cnpc;*.petrochina;10.*.*.*;11.*.*.*;localhost*;<local>" /f ipconfig /flushdns start "" "C:\Program Files\Internet Explorer\iexplore.exe" taskkill /f /im iexplore.exe
关闭代理:
@echo off 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 ipconfig /flushdns start "" "C:\Program Files\Internet Explorer\iexplore.exe" taskkill /f /im iexplore.exe