I have created a simple batch file that will switch between whatever you set as a proxy server and turn on "Use a proxy server" in IE settings, and no server and turn off "Use a proxy server" in IE settings. I saw that you did not want to mess with your registry, however, this is the only way to set these settings from a batch file.
Code:
Code:
@echo off
REM Input your desired proxy server after "set proxy=".
set proxy=127.0.0.1:123
if '%proxy%'=='' (
goto USAGE
)
echo.
for /F "eol= tokens=1* " %%a in ('REG Query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v proxyserver /t REG_SZ 2^>nul ^| find "REG_SZ"') do set str=%%b
set str=%str:~10,20%
if '%str%'=='' (
set str=Not assigned
)
echo Current proxy server: %str%
echo.
if "%str%"=="%proxy%" (
goto off
) else (
goto on
)
:ON
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v proxyserver /t REG_SZ /d "%proxy%" /f >nul
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v proxyenable /t REG_DWORD /d "1" /f >nul
for /F "eol= tokens=1* " %%a in ('REG Query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v proxyserver /t REG_SZ 2^>nul ^| find "REG_SZ"') do set str=%%b
set str=%str:~10,20%
if '%str%'=='' (
set str=Not assigned
)
echo New proxy server: %str%
echo.
pause
goto end
:OFF
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v proxyserver /t REG_SZ /d "" /f >nul
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v proxyenable /t REG_DWORD /d "0" /f >nul
for /F "eol= tokens=1* " %%a in ('REG Query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v proxyserver /t REG_SZ 2^>nul ^| find "REG_SZ"') do set str=%%b
set str=%str:~10,20%
if '%str%'=='' (
set str=Not assigned
)
echo New proxy server: %str%
echo.
pause
GOTO END
:USAGE
echo.
echo Please input a proxy server to configure.
echo.
pause
goto end
:END
exit