📜 ⬆️ ⬇️

Proxy at work and the lack of it at home

Or got a tick

photo hosting
At my work, like many others, the Internet works through Proxy, naturally every morning (since I have a laptop that is always with me) I have to crawl into settings and tick this box when I come home from work, again I need to remove it. In general, sick ...


Solution to the problem

Probably there are special programs for managing Proxy servers if anyone knows who can list them in the comments. I went the other way. This option is responsible for checking the registry.

HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable

We write a bat file which will quickly invert us this value.
')
@echo off<br>
set REGDIR="HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"<br>
ping 192.168.0.242 -n 1<br>
if "%errorlevel%"=="0" ( REG ADD %REGDIR% /v ProxyEnable /t REG_DWORD /d 1 /f<br>
echo "work"<br>
) else (<br>
REG ADD %REGDIR% /v ProxyEnable /t REG_DWORD /d 0 /f<br>
echo "home"<br>
)<br>


Where is the 192.168.0.242 ip address of my internet proxy at work
The algorithm is simple, pinging Proxy if pinging means at work we put a tick on it anyway then we remove the tick
All this is copied to * .bat and used

Who cares to read about the command line asking the court or there

UPDATE: works in both IE and Chrome

Source: https://habr.com/ru/post/55348/


All Articles