I am having this simple two line script to set and remove my HTTP_PROXY when needed .
IF not defined HTTP_PROXY (setx HTTP_PROXY http://user:pass@212.212.212.212:29842) ELSE (REG delete HKCU\Environment /F /V HTTP_PROXY)
IF not defined HTTPS_PROXY (setx HTTPS_PROXY http://user:pass@212.212.212.212:29842) ELSE (REG delete HKCU\Environment /F /V HTTPS_PROXY)
what am trying to do is to trigger the HTTP_PROXY environment .
But when i run as administrator the first time , the value is added and proxy is configured .
Second time , The value is removed and the proxy still configured .
Even when i cant even see the HTTP_PROXY with environment variable i can still get the config with new terminal with echo %HTTP_PROXY%
Am i deleting the value wrong , or my problem is with adding ?